Jump to content

how to include RakNet into LE project


VicToMeyeZR
 Share

Recommended Posts

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

AMD Phenom II x6 1100T - 16GB RAM - ATI 5870 HD - OCZ Vertex 2 60GB SSD

76561197984667096.png

Link to comment
Share on other sites

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

LE Version: 2.50 (Eventually)

Link to comment
Share on other sites

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

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

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...