Page 1 of 1

odac 6.90.0.54 bcb 2009 -> trouble with includes

Posted: Fri 04 Dec 2009 13:05
by albourgz
Dear all,

I had many projects compiling without any trouble using odac 6.90.0.53.
After upgrading oracle to 6.90.0.54 ind installing dbmonitor 3 (no db monitor before), most projects refuse to compile because of:
error ws2def.h(208): E2238 Multiple declaration for sockaddr
...

Here is a sample dm.cpp:

Code: Select all

#include 
#pragma hdrstop


#include "DM.h"
#include "GDB.h"

//-----------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "DBAccess"
#pragma link "MemDS"
#pragma link "Ora"
#pragma link "OraSmart"
#pragma link "OraAlerter"
#pragma link "DAAlerter"
#pragma resource "*.dfm"

TFDM *FDM;
//---------------------------------------------------------------------------
__fastcall TFDM::TFDM(TComponent* Owner)
	: TDataModule(Owner)
....
What is strange: Adding a

Code: Select all

#include 
just after

Code: Select all

#pragma hdrstop
solves the problem.


What is strange: Adding a

Code: Select all

#include 
just after

Code: Select all

#include "DM.h" 
does NOT solve the problem.

the dm.h only holds

Code: Select all

//---------------------------------------------------------------------------
#ifndef DMH
#define DMH
//---------------------------------------------------------------------------
#include 
#include 
#include 
#include 
#include 
#include 
#include "DBAccess.hpp"
#include "MemDS.hpp"
#include "Ora.hpp"
#include "OdacVcl.hpp"
#include "OraSmart.hpp"
#include "OraAlerter.hpp"
#include "DAAlerter.hpp"
//---------------------------------------------------------------------------
class TFDM : public TDataModule
{
__published:	// IDE-managed Components
	TOraQuery *QProductDDLB;
	TDataSource *DSProductDDLB;
	TOraQuery *QLanguageDDLB;
	TDataSource *DSLanguageDDLB;
	TOraQuery *QCardsSitesDDLB;
	TDataSource *DSCardsSites;
	TOraQuery *QUserDDLB;
	TDataSource *DSUserDDLB;
	TDataSource *DSReasons;
	TOraQuery *QReasonsDDLB;
	TOraQuery *QOwnerDDLB;
	TDataSource *DSOwnerDDLB;
	TOraQuery *QNatureDDLB;
	TDataSource *DSNatureDDLB;
	TOraQuery *QCategoryDDLB;
	TDataSource *DSCategoryDDLB;
	TOraQuery *QTrackTypeDDLB;
	TDataSource *DSTrackTypeDDLB;
	TOraQuery *QCardTypeDDLB;
	TDataSource *DSCardTypeDDLB;
	TOraQuery *QProductTypeDDLB;
	TDataSource *DSProductTypeDDLB;
	TOraQuery *QChipTypeDDLB;
	TDataSource *DSChipTypeDDLB;
	TOraQuery *QMarketingTypeDDLB;
	TDataSource *DSMarketingTypes;
    TOraQuery *QCurrencyDDLB;
    TDataSource *DSCurrencyDDLB;
    TOraQuery *QProjectDDLB;
    TDataSource *DSProjectDDLB;
    TDataSource *DSSiteRefDDLB;
    TOraQuery *QSiteRefDDLB;
    TOraQuery *QProductDDLBR;
    TDataSource *DSProductDDLBR;
    TOraQuery *QClientDDLB;
    TDataSource *DSClientDDLB;
    TOraQuery *QPeople;
    TOraSession *OurDB;
    TConnectDialog *ConnectDialog1;
    TOraQuery *QASProjects;
    TOraQuery *QASProjectsStages;
    TOraQuery *QAsProjectsWithEmpty;
    TOraQuery *QLibelles;
    TOraQuery *QAddBatchGroup;
    TOraQuery *UpdateBatchGroupState;
    TOraQuery *UpdateBatchGroupCounts;
    TOraQuery *GetBatchGroupCounts;
    TOraQuery *OraKillMessage;
    TOraQuery *OraSetMessageStatus;
    TOraQuery *QGetStageIDFromNameAndWay;
    TOraQuery *QLog;
    TSmartQuery *SMQuery;
    TOraAlerter *OraAlerter1;
	TOraQuery *UpdateBatchGroupStateAndCount;
    TOraQuery *QUpdMachineCount;
    TOraQuery *QMachineLog;
    TOraQuery *QShift;
    TOraQuery *QLastShift;
    TOraQuery *QLogSetReady;
    TOraQuery *QDepanInfo;
    TFloatField *QDepanInfoID;
    TStringField *QDepanInfoMACHINEID;
    TDateTimeField *QDepanInfoDTBEGIN;
    TStringField *QDepanInfoOPEASKER;
    TStringField *QDepanInfoOPESERVER;
    TStringField *QDepanInfoTYPE;
    TStringField *QDepanInfoTROUBLESTATUS;
    TDateTimeField *QDepanInfoDTSOLVED;
    TFloatField *QDepanInfoPRIORITY;
    TFloatField *QDepanInfoTIMEPRESTEDHOURS;
    TStringField *QDepanInfoSYNOPSIS;
    TFloatField *QDepanInfoTHREADID;
    TOraQuery *QLibelles2;
    TOraQuery *QDepartmentsDDLB;
    TFloatField *QDepanInfoRESPONDINGDEPARTMENT;
    TFloatField *QDepanInfoASKINGDEPARTMENT;
    TOraQuery *QMachineHistory;
    TOraQuery *QInsPlannedStopAsked;
    TOraQuery *QInsEntretienMachine;
    TOraQuery *QSetAllowID;
    TOraQuery *QRefusePlannedStop;
    TOraQuery *QProductSetLastUse;
    TOraStoredProc *SPStockInfo;
    TOraQuery *QGetEMailFromTrigram;
	TOraQuery *QQualCheckNeeded;
    TOraQuery *QAddThreadProp;
    TOraQuery *QTotProdExcel;
    TOraQuery *QUnplannedTroublesMonitor;
    TOraQuery *QSMUQTDest;
    TOraQuery *QSMUQTOrig;
    TOraQuery *QSMQTM;
    TOraQuery *QSMDM;
    TOraQuery *QReadSM;
    TOraQuery *QSMVUQT;
    TOraQuery *QSMSTQTI;
    TOraQuery *QGetMoulRefs;
    TStringField *QGetMoulRefsREF;
    TDateTimeField *QDepanInfoDTSTARTWORK;
    TStringField *QDepanInfoGARDE;
    TFloatField *QDepanInfoCATDEP;
    TFloatField *QDepanInfoSUBCATDEP;
    TOraQuery *QINSBatchGroup;
    TOraQuery *QINSBatchGroup2;
	TOraQuery *QGetGroupHold;
	TOraQuery *QInsSerials;
	TOraQuery *QSerBooks;
	TOraQuery *QUnplannedTroubleInsert;
	TOraQuery *QgroupMaySetReady;
	TOraQuery *QGetEidOutReasons;
	TOraQuery *QThreadToRead;
	TOraQuery *QRThreadToRead;
    void __fastcall OurDBError(TObject *Sender, EDAError *E, bool &Fail);
	void __fastcall OurDBBeforeDisconnect(TObject *Sender);
	void __fastcall OraAlerter1TimeOut(TObject *Sender, bool &Continue);
	void __fastcall OurDBConnectionLost(TObject *Sender, TComponent *Component, TConnLostCause ConnLostCause,
		  TRetryMode &RetryMode);
private:	// User declarations
public:		// User declarations
	bool bBatchMode;
	__fastcall TFDM(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TFDM *FDM;
//---------------------------------------------------------------------------
#endif
It even seems that adding

Code: Select all

#include 
as last include of any form holding odac components causes an error (and added as first include causes no error).

So it seems has to be included manually at the top of each module... and it worked fine before (!).

Do you have a better solution?

Regards,
Alain

Posted: Mon 07 Dec 2009 08:36
by Plash
We could not reproduce the problem. Please send to support*devart*com a complete small sample that demonstrates the problem.

Posted: Sun 20 Dec 2009 13:27
by riwe
The same with BCB2010! It seems that this error occurs in combination with Indy, when you use Indy components and ODAC components in the same form.

Posted: Mon 21 Dec 2009 09:05
by Plash
To fix the problem:
open the DBMonitorMessages.hpp file (from \Include);
replace the following line:

Code: Select all

#include 
with

Code: Select all

#include