Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

C++Builder 2010 (RAD studio 2010)


#1

Are the examples/tutorials for C++Builder 2010 (in RAD studio 2010)? I can’t get it to work…

When adding; #include "SiAuto.hpp"
I get;

[BCC32 Error] ws2def.h(213): E2238 Multiple declaration for 'sockaddr’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
Winsock2.h(113): #include c:\program files\embarcadero\rad studio\7.0\include\ws2def.h
[BCC32 Error] winsock.h(486): E2344 Earlier declaration of 'sockaddr’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
Winsock2.h(113): #include c:\program files\embarcadero\rad studio\7.0\include\ws2def.h
[BCC32 Error] ws2def.h(222): E2146 Need an identifier to declare
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
Winsock2.h(113): #include c:\program files\embarcadero\rad studio\7.0\include\ws2def.h
[BCC32 Error] ws2def.h(391): E2184 Enum syntax error
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
Winsock2.h(113): #include c:\program files\embarcadero\rad studio\7.0\include\ws2def.h
[BCC32 Error] ws2def.h(444): E2040 Declaration terminated incorrectly
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
Winsock2.h(113): #include c:\program files\embarcadero\rad studio\7.0\include\ws2def.h
[BCC32 Error] ws2def.h(444): E2303 Type name expected
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
Winsock2.h(113): #include c:\program files\embarcadero\rad studio\7.0\include\ws2def.h
[BCC32 Error] ws2def.h(584): E2238 Multiple declaration for 'sockaddr_in’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
Winsock2.h(113): #include c:\program files\embarcadero\rad studio\7.0\include\ws2def.h
[BCC32 Error] winsock.h(313): E2344 Earlier declaration of 'sockaddr_in’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
Winsock2.h(113): #include c:\program files\embarcadero\rad studio\7.0\include\ws2def.h
[BCC32 Error] ws2def.h(595): E2146 Need an identifier to declare
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
Winsock2.h(113): #include c:\program files\embarcadero\rad studio\7.0\include\ws2def.h
[BCC32 Error] ws2def.h(965): E2190 Unexpected }
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
Winsock2.h(113): #include c:\program files\embarcadero\rad studio\7.0\include\ws2def.h
[BCC32 Error] Winsock2.h(133): E2238 Multiple declaration for 'fd_set’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] winsock.h(69): E2344 Earlier declaration of 'fd_set’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(136): E2146 Need an identifier to declare
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(177): E2238 Multiple declaration for 'timeval’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] winsock.h(112): E2344 Earlier declaration of 'timeval’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(233): E2238 Multiple declaration for 'hostent’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] winsock.h(168): E2344 Earlier declaration of 'hostent’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(246): E2238 Multiple declaration for 'netent’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] winsock.h(181): E2344 Earlier declaration of 'netent’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(253): E2238 Multiple declaration for 'servent’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] winsock.h(188): E2344 Earlier declaration of 'servent’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(265): E2238 Multiple declaration for 'protoent’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] winsock.h(200): E2344 Earlier declaration of 'protoent’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(361): E2238 Multiple declaration for 'WSAData’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] winsock.h(323): E2344 Earlier declaration of 'WSAData’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(377): E2146 Need an identifier to declare
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(459): E2238 Multiple declaration for 'sockproto’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] winsock.h(495): E2344 Earlier declaration of 'sockproto’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(501): E2238 Multiple declaration for 'linger’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] winsock.h(532): E2344 Earlier declaration of 'linger’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Winsock2.h(3975): E2190 Unexpected }
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(28): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Siwinsock2.hpp
Siwinsock2.hpp(21): #include c:\program files\embarcadero\rad studio\7.0\include\Winsock2.h
[BCC32 Error] Smartinspect.hpp(1117): E2015 Ambiguity between ‘TSockAddrIn’ and 'Winsock::TSockAddrIn’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(34): namespace Smartinspect
Smartinspect.hpp(1104): class TSiTcpClient
[BCC32 Error] Smartinspect.hpp(1118): E2015 Ambiguity between ‘PSockAddrIn’ and 'Winsock::PSockAddrIn’
Full parser context
TerpClient.cpp(11): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphi2010\Smartinspect.hpp
Smartinspect.hpp(34): namespace Smartinspect
Smartinspect.hpp(1104): class TSiTcpClient


#2

Hello Roland,

Thanks for your posting. I haven’t seen this error before but it seems to be related to the WinSock unit we are using in the SmartInspect library. I will try to reproduce this behavior here. Do you also use a WinSock library or Indy in your application?

Regards,
Tobias


#3

No but I’m using datasnap which maybe uses the winsock… For the logging part I don’t need the network stuff. Is this easy to remove?

Regards,

Roland

[quote=tgurock]Hello Roland,

Thanks for your posting. I haven’t seen this error before but it seems to be related to the WinSock unit we are using in the SmartInspect library. I will try to reproduce this behavior here. Do you also use a WinSock library or Indy in your application?

Regards,
Tobias[/quote]


#4

There’s no easy way to remove the TCP/IP related code from the SmartInspect library. It can be done by removing the relevant parts/classes from the SmartInspect.pas source code but there’s no simple define/ifdef or something similar that disables/removes this code. I will make sure to test it with C++Builder 2010 and DataSnap (or something else that uses WinSock).

We do not have any tutorials for C++Builder like we have for the other languages/IDEs but I will make sure to send you a simple example project later today via email.

Regards,
Tobias


#5

Thanks,

I wait for your example project.

Regards,

Roland Beuker

[quote=tgurock]There’s no easy way to remove the TCP/IP related code from the SmartInspect library. It can be done by removing the relevant parts/classes from the SmartInspect.pas source code but there’s no simple define/ifdef or something similar that disables/removes this code. I will make sure to test it with C++Builder 2010 and DataSnap (or something else that uses WinSock).

We do not have any tutorials for C++Builder like we have for the other languages/IDEs but I will make sure to send you a simple example project later today via email.

Regards,
Tobias[/quote]


#6

Hello Tobias,

I got it working :slight_smile:

The [quote]#include <SiAuto.hpp>[/quote] has to be inserted before [quote]#pragma hdrstop[/quote]

#include <vcl.h>
#include <SiAuto.hpp>
#pragma hdrstop


#7

Thanks for the update, Roland. Great that you got it working. :slight_smile:

Regards,
Tobias


#8

[quote=tgurock]Thanks for the update, Roland. Great that you got it working. :slight_smile:

Regards,
Tobias[/quote]

Hello Tobias,

SmartInspect works this way, BUT the pre-compiled header function is corrupted when included are placed before the #pragma hdrstop :frowning:

#include <vcl.h>
#include <SiAuto.hpp>
#pragma hdrstop

Now I have very very long build times (several minutes)… This very long delays are not acceptable. Is there another solution?


#9

Hello Roland,

Thanks for the update. I will take a look and try to find a better solution. If we can’t get it working because of the winsock conflicts, I can prepare a special version without the network code (as you mentioned that you don’t need it).

Regards,
Tobias


#10

Roland,

Could you try to use SiAuto.hpp as the first unit after the ‘#pragma hdrstop’ line (or at least, include it before those units that include winsock.h directly/indirectly)? This did the trick for me.

Regards,
Tobias


#11

Hello Tobias,

Yes this works :slight_smile: Maybe you should consider to prefix your ‘Multiple declaration’ classes with its base class in your source code…

Regards,

Roland


#12

Thanks for the confirmation, Roland. Yes, the naming is definitely something to consider (maybe we add a ‘Si’ prefix to each type declared in SiWinsock).

Regards,
Tobias


#13

I am receiving similar error as Roland:

[BCC32 Error] SmartInspect.hpp(1180): E2015 Ambiguity between ‘Siwinsock2::TSockAddrIn’ and 'Winapi::Winsock2::TSockAddrIn’
Full parser context
elma.cpp(1): #include pch.h
pch.h(7): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphiXE2\SiAuto.hpp
SiAuto.hpp(18): #include C:\Program Files\Gurock Software\SmartInspect Professional\lib\delphi\delphiXE2\SmartInspect.hpp
SmartInspect.hpp(35): namespace Smartinspect
SmartInspect.hpp(1167): class Smartinspect::TSiTcpClient

Winsock library is automatically included as part of VCL library when including file vcl.h (even when I am not using network communication). Problem could be avoided by changing include statements order. But I think this is not good solution from conceptual point of view. It corrupts the good image of product (this is my first meet with SI).


#14

Thanks for your posting. Yes, this is not optimal but the workaround mentioned above should work fine actually. Do you see a different behavior?

Regards,
Tobias


#15

[quote=tgurock]Thanks for your posting. Yes, this is not optimal but the workaround mentioned above should work fine actually. Do you see a different behavior?

Regards,
Tobias[/quote]

Yes, the workaround works but it interferes with precompiled header functionality of C++ Builder. <vcl.h> is ideal candidate for precompiled header, because of this it is by default placed into pch.h. Placing #include <SiAuto.hpp> before it results into following Warning message by compiler:

[BCC32 Warning] System.DateUtils.hpp(132): W8058 Cannot create pre-compiled header: initialized data in header

This isn’t fault of Gurock Software but Embarcadero. Its old bug reported in 2006 and not solved to these days:
http://qc.embarcadero.com/wc/qcmain.aspx?d=23002

Problem is that I am forced to place SI include into precompiled-header section (because of ambiguity of Winsock objects). In the worst case (using log system in most modules) this can effectively disable precompiled headers in all the project. This can result in serious degradation of compiler performance:

Without #include <SiAuto.hpp> in pch.h - 99 seconds
With #include <SiAuto.hpp> in pch.h - 247 seconds

Maybe it suffices to resolve name ambiguity by using fully qualified names.


#16

Hello,

Thanks for the additional details. Another alternative that should work would be to use different names for the types in SiWinsock2.pas (e.g., TSockAddrIn -> TSiSockAddrIn) to avoid the name collision.

Regards,
Tobias