VicToMeyeZR Posted September 10, 2011 Share Posted September 10, 2011 I seem to always get a bunch of Windows SDK errors if I try to include raknet into my LE project. Any of y'all that are using RakNet how did you setup your projects? Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Laurens Posted September 10, 2011 Share Posted September 10, 2011 What kind of errors are you getting? If you could post the build/link log, we can probably tell what the problem is. Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted September 10, 2011 Author Share Posted September 10, 2011 Build started 9/10/2011 11:42:48 AM. 1>Project "C:\Leadwerks Engine SDK\projects\Tergus\Tergus.vcxproj" on node 3 (build target(s)). 1>InitializeBuildStatus: Touching "Release\Tergus.unsuccessfulbuild". ClCompile: C:\Program Files\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /I"C:\Leadwerks Engine SDK\CPP" /I"C:\dev\RakNet_PC-4.031\Source" /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D WIN32 /D NDEBUG /D _CONSOLE /D _RAKNET_DLL /D _UNICODE /D UNICODE /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Release\\" /Fd"Release\vc100.pdb" /Gd /TP /analyze- /errorReport:prompt ..\..\CPP\engine.cpp Tergus.cpp engine.cpp Tergus.cpp 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(91): warning C4005: 'AF_IPX' : macro redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(460) : see previous definition of 'AF_IPX' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(131): warning C4005: 'AF_MAX' : macro redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(479) : see previous definition of 'AF_MAX' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(168): warning C4005: 'SO_DONTLINGER' : macro redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(402) : see previous definition of 'SO_DONTLINGER' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(212): error C2011: 'sockaddr' : 'struct' type redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(485) : see declaration of 'sockaddr' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(390): error C2059: syntax error : 'constant' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(390): error C3805: 'constant': unexpected token, expected either '}' or a ',' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(524): warning C4005: 'IN_CLASSA' : macro redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(287) : see previous definition of 'IN_CLASSA' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(530): warning C4005: 'IN_CLASSB' : macro redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(293) : see previous definition of 'IN_CLASSB' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(536): warning C4005: 'IN_CLASSC' : macro redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(299) : see previous definition of 'IN_CLASSC' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(547): warning C4005: 'INADDR_ANY' : macro redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(304) : see previous definition of 'INADDR_ANY' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(549): warning C4005: 'INADDR_BROADCAST' : macro redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(306) : see previous definition of 'INADDR_BROADCAST' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\ws2def.h(583): error C2011: 'sockaddr_in' : 'struct' type redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(312) : see declaration of 'sockaddr_in' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock2.h(132): error C2011: 'fd_set' : 'struct' type redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(68) : see declaration of 'fd_set' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock2.h(167): warning C4005: 'FD_SET' : macro redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(102) : see previous definition of 'FD_SET' 1>C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock2.h(176): error C2011: 'timeval' : 'struct' type redefinition C:\Program Files\Microsoft SDKs\Windows\v7.0A\include\winsock.h(111) : see declaration of 'timeval' That only about half of it. All I am including is the header files to the project, then I use #include "RakPeerInterface.h" It seems to be header conflicting between the engine headers and the raknet headers... I really hate compilers, I can never understand how the freaking things work. lol Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Laurens Posted September 10, 2011 Share Posted September 10, 2011 Are you including the windows API yourself? If you are, the ordering is important. I don't remember if you need to include either windows.h or RakNet first though but try both and see what works. Cheers! Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted September 10, 2011 Author Share Posted September 10, 2011 Im not including anything.. The engine includes Windows.h but I will try it Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Mumbles Posted September 10, 2011 Share Posted September 10, 2011 Im not including anything.. The engine includes Windows.h but I will try it Similar but not identical, I use winsock. I have to include winsock2.h before engine.h otherwise I get a load of redefinition errors, kinda like the ones you look to be getting WIN32_LEAN_AND_MEAN makes no difference just in case you were curious... Edit: infact, maybe try including winsock2.h - since it seems to include almost everything windows.h does anyway Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted September 10, 2011 Author Share Posted September 10, 2011 Mumbles, that was the issue Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Road Kill Kenny Posted September 10, 2011 Share Posted September 10, 2011 Hehe I had a problem with this one.. There is a bug in some windows stuff.. To fix it you must either: 1: Include all RakNet includes before engine.h or 2: #include "WindowsIncludes.h" before you include engine.h (WindowsIncludes.h is in the RakNet Source) It took me a while to figure this out first time but at least its a nice easy fix Quote STS - Scarlet Thread Studios AKA: Engineer Ken Fact: Game Development is hard... very bloody hard.. If you are not prepared to accept that.. Please give up now! Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted September 11, 2011 Author Share Posted September 11, 2011 Well, I am glad its not just me. Thanks Ken, I will try that also. Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted September 12, 2011 Author Share Posted September 12, 2011 Yes Ken, that worked perfectly. thank you Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted September 12, 2011 Share Posted September 12, 2011 verrrrry informative thread... thx guys... --Mike Quote Link to comment Share on other sites More sharing options...
Rick Posted September 12, 2011 Share Posted September 12, 2011 It's been awhile since I've played with RakNet so thanks for this refresher. I'm about to make a DLL that uses RakNet for using with Lua for my game and if I'm able to make it generic enough I'll release how I did it for others to do. I don't think I can release the actual DLL as the RakNet guy frowns on that I guess. Quote Link to comment Share on other sites More sharing options...
VicToMeyeZR Posted September 12, 2011 Author Share Posted September 12, 2011 Yeah, since 4.0 he has kind of got a little more tight with the system... But its all good. I was going to try to wrap into lua myself, as I think it would be to confusing to have half written in c++ and half in lua.. Quote AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.