Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RAD i think it's winsock problem.I'm stuck(it's been a few days)

Status
Not open for further replies.

esmet

Programmer
Jul 25, 2011
16
[BCC32 Error] Winsock.hpp(23): E2257 , expected
[BCC32 Error] Winsock.hpp(30): E2257 , expected
[BCC32 Error] Winsock.hpp(34): E2257 , expected
[BCC32 Error] Winsock.hpp(38): E2257 , expected
[BCC32 Error] Winsock.hpp(42): E2257 , expected
[BCC32 Error] Winsock.hpp(46): E2257 , expected
[BCC32 Error] Winsock.hpp(50): E2257 , expected
[BCC32 Error] Winsock.hpp(54): E2257 , expected
[BCC32 Error] Winsock.hpp(58): E2257 , expected
[BCC32 Error] Winsock.hpp(62): E2257 , expected
[BCC32 Error] Winsock.hpp(66): E2257 , expected
[BCC32 Error] functional(838): E2238 Multiple declaration for 'operator hash<wstring>::()(const wstring &) const'
[BCC32 Error] functional(794): E2344 Earlier declaration of 'operator hash<wstring>::()(const wstring &) const'
[BCC32 Error] winsock2.h(138): E2015 Ambiguity between 'fd_set' and 'Winsock::fd_set'
[BCC32 Error] winsock2.h(1918): E2015 Ambiguity between 'fd_set' and 'Winsock::fd_set'
[BCC32 Error] winsock2.h(1919): E2015 Ambiguity between 'fd_set' and 'Winsock::fd_set'
[BCC32 Error] winsock2.h(1920): E2015 Ambiguity between 'fd_set' and 'Winsock::fd_set'
[BCC32 Error] winsock2.h(1918): E2015 Ambiguity between 'fd_set' and 'Winsock::fd_set'
[BCC32 Error] winsock2.h(1919): E2015 Ambiguity between 'fd_set' and 'Winsock::fd_set'
[BCC32 Error] winsock2.h(1920): E2015 Ambiguity between 'fd_set' and 'Winsock::fd_set'
[BCC32 Error] ScktComp.hpp(121): E2015 Ambiguity between 'sockaddr_in' and 'Winsock::sockaddr_in'
[BCC32 Error] ScktComp.hpp(148): E2015 Ambiguity between 'sockaddr_in' and 'Winsock::sockaddr_in'
[BCC32 Error] ScktComp.hpp(154): E2015 Ambiguity between 'sockaddr_in' and 'Winsock::sockaddr_in'
[BCC32 Error] ScktComp.hpp(174): E2015 Ambiguity between 'in_addr' and 'Winsock::in_addr'
[BCC32 Error] ScktComp.hpp(189): E2015 Ambiguity between 'sockaddr_in' and 'Winsock::sockaddr_in'
[BCC32 Error] ScktComp.hpp(191): E2015 Ambiguity between 'sockaddr_in' and 'Winsock::sockaddr_in'
[BCC32 Error] Idwinsock2.hpp(33): E2015 Ambiguity between 'fd_set' and 'Winsock::fd_set'
[BCC32 Error] Idwinsock2.hpp(34): E2015 Ambiguity between 'fd_set' and 'Winsock::fd_set'

I,ve changed conditional defines in project options to _WINSOCKAPI_
I use a lot of headers and don't know what to do now, and my boss is going to kill me if i don't, do it(it's my first job). All opinions are welcome.
 
By the way i'm converting from builder 6 to 2010.
 
You are going to have work through your propietary headers (ones that were written by your company). Since you are converting from BCB6 to 2010, pay particular attention to VCL calls where you need to convert from AnsiString to UnicodeString. Next, check for function prototype differences between BCB6 and 2010. (I don't believe there are that many). Any kind of error in a previous header can cause problems later in known to be stable headers, mainly because the offending header does not get completely processed.
 
This may not be of any help, but the few occasions I have had trouble with winsock stuff was related to the order of the header files. I was using some purchased MySQL libraries, which apparently used winsock stuff, and some Indy components. Based on the suggestions of Builder users much smarter than me, I swapped the order of the header files and the problem went away.

It has been several years, but I think the errors as claimed by Builder were between winsock.h and winsock2.h and were of a similar nature to what you have written above, even though I personally had not #include'ed either header. In fact, the headers were #included for me by the IDE as I slapped on the form the components mentioned above.

Steve.
 
I think i have a temporary solution. And i'm using it 'til I won't find anything else, I'm including <winsock2.h> in every *.cpp that have these certain errors,so I can do my work, but I'm not sure that there is some much better solution cuz I've tried a few #define _WINSOCKAPI_ and #define WIN32_LEAN_AND_MEAN and to add the winsock2.h before windows.h, but it turns out that <vcl.h> somehow refers to winsock.h as well, so you have to add winsock2.h before those 2 headers. If I'll find sth new about it I'll keep you posted. Thanks for advices.

Regards,
esmet

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top