Unreal 3.2.1 Win32 Build Problems - type redefinition errors

These are old archives. They are kept for historic purposes only.
Post Reply
rocafella
Posts: 2
Joined: Fri Jul 09, 2004 7:37 pm

Unreal 3.2.1 Win32 Build Problems - type redefinition errors

Post by rocafella »

When compiling UnrealIRCd 3.2.1, with openssl enabled, under Windows (using Visual Studio 2003), I recieve the following errors:

Code: Select all

cl /MD /O2 /G5 /I ""D:\Development\LibCurl\include"" /I ""D:\Development\ZLib"" /I ""D:\Development\OpenSSL\include"" /J /I ./INCLUDE /Fosrc/ /nologo  /D ZIP_LINKS /D ZLIB_DLL /D USE_LIBCURL /D FD_SETSIZE=16384 /D USE_SSL  /D NOSPOOF=1 /c src/ircd.c
ircd.c
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(109) : error C2011: 'fd_set' : 'struct' type redefinition
        C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(54) : see declaration of 'fd_set'
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock2.h(144) : warning C4005: 'FD_SET' : macro redefinition
        C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinSock.h(88) : see previous definition of 'FD_SET'

...
Following this is dozens of "type redefinition" errors of various structs. Any ideas on how to resolve this issue?

Thanks for your time. :)
Syzop
UnrealIRCd head coder
Posts: 2179
Joined: Sat Mar 06, 2004 8:57 pm
Location: .nl
Contact:

Post by Syzop »

Actually *IIRC* this is due to curl.
codemastr
Former UnrealIRCd head coder
Posts: 811
Joined: Sat Mar 06, 2004 8:47 pm
Location: United States
Contact:

Post by codemastr »

Yeah, did you install libcurl as well?
-- codemastr
aquanight
Official supporter
Posts: 862
Joined: Tue Mar 09, 2004 10:47 pm
Location: Boise, ID

Post by aquanight »

Actually I had this same problem.

And fixed it.

How? Pull up your favorite text editor. Navigate to your Platform SDK Include folder. Open winsock2.h.

After the huge comment at the beginning, add:

#ifndef _WINSOCKAPI_ /* HACK: Prevent inclusion of WS2 if WS1 is already here. */

Then go down to the end of the file and add:

#endif /* _WINSOCKAPI_ */

My analysis was that for some reason winsock.h was being included, followed by winsock2.h. Ideally, winsock2.h would be included first, which would prevent winsock.h from causing errors if it were included later. But when it is the other way around, errors such as this can occur :P . By adding these lines, winsock2.h will check if winsock.h was already included, and if so, will not define anything :P .

*edit* The only reason I'm suggesting it is because it's probably something M$ should've had anyway :P */edit*
fez
Posts: 3
Joined: Mon Mar 08, 2004 12:59 am
Location: Minneapolis, MN, USA
Contact:

my solution

Post by fez »

my solution was to go to the curl directory, and open include/curl/multi.h
and change line 55

#include <winsock2.h>

to

#include <winsock.h>

that fixes it.


-- fez
rocafella
Posts: 2
Joined: Fri Jul 09, 2004 7:37 pm

Post by rocafella »

codemastr: Yes, I did install libcurl.

fez: Thank you, this worked perfectly.

Perhaps add this note to the compiling_win32.txt guide, in case someone else runs into trouble? :)

Thank for the help.
Shane
Posts: 5
Joined: Sun Jul 11, 2004 9:57 am

Post by Shane »

i got the same problem but my stupid step was put away libcurl -.-"
thank u all above~
Post Reply