Page 10 of 16

I beating my head on a wall!

Posted: Mon Apr 09, 2007 11:25 pm
by raven_coda
Hey can anybody quickly point out what I'm missing? Using Visual Studio, all the files are included in my solution (minus the two unix files) but here's what I'm getting...

Error 7 error LNK2001: unresolved external symbol _enet_time_get protocol.obj

Error 12 error LNK2019: unresolved external symbol _enet_address_set_host referenced in function "public: void __thiscall irr::net::INetManager::setUpClient(void)" (?setUpClient@INetManager@net@irr@@QAEXXZ) NetManager.obj

Can someone help me see what I missing?

Posted: Tue Apr 10, 2007 8:13 am
by roxaz
some dll or lib are missing

Posted: Tue Apr 10, 2007 11:31 pm
by raven_coda
he he, thanks roxaz but I kindof already knew something was missing, I was hoping someone could show me what :wink:

I finally decided to give up on making enet into a static library and just included everything under the sun in my project. That way I was able to get it to compile. However, I'm getting memory corruption. It occurs during a memcpy (typical :roll: ) in NetManager.cpp line about line 423

Code: Select all

memcpy((char*)&netid,buff+1,2);
I'm just compiling example2 so I'm not doing anything crazy.

Is anybody using Visual Studio 5 and is able to get irrnet .36 to work right?

Posted: Wed Apr 11, 2007 12:14 am
by Midnight
visual studio 5?

come on dude time for an upgrade seriously.

never used it even.. before my time.

have you tried msvc 8 express?

Posted: Wed Apr 11, 2007 12:25 am
by raven_coda
LOL :lol: sorry, don't know what I was thinking. I am using Visual Studio 8 haven't touch VS5 since middle school. I think I need some sleep! :shock:

Posted: Thu Apr 12, 2007 8:17 am
by BlindSide
If you have already defined WIN32 then I can't tell what is wrong other than looking at your project file, damn I hate these linker errors they piss me off. Try to include all the Enet c files (The enet that comes with irrnet, including the linux ones) and just one enet header file that is "enet.h". Make sure they are all in your linker and include directories. Keep tweaking all the project settings until something works lol.

Posted: Thu Apr 12, 2007 11:27 am
by sudi
I had similar problems with using enet myself.....i solved it by using interafaces. define interfaces for all ur network stuff and compile the code into a dll or something(only usefull for windows users but i guess linux users won'T have problems..)then the useres only have to include ur interface headers and only have to link to ur dll.

Posted: Thu Apr 12, 2007 1:48 pm
by MickeyKnox
I cant get irrnet to compile too:

g++ -I../lib/irrlicht-1.3/include -I/usr/X11R6/include -I../lib/irrNet/ -I../lib/irrNet/enet/include -I../lib/irrNet/enet -O3 -ffast-math source/main.cpp source/RTSCamera.cpp -o tai -L/usr/X11R6/lib -L../lib/irrlicht-1.3/lib/Linux -lIrrlicht -lGL -lGLU -lXxf86vm -lXext -lX11
In file included from ../lib/irrNet/irrNet.h:4,
from source/main.cpp:2:
../lib/irrNet/NetManager.h:5:22: error: Irrlicht.h: No such file or directory
../lib/irrNet/NetManager.h:844:5: warning: no newline at end of file
In file included from ../lib/irrNet/irrNet.h:5,
from source/main.cpp:2:
../lib/irrNet/NetAnim.h:87:5: warning: no newline at end of file
In file included from source/main.cpp:2:
../lib/irrNet/irrNet.h:28:5: warning: no newline at end of file
../lib/irrNet/Packets.h:63: error: 'MAX_PATH' was not declared in this scope
../lib/irrNet/NetManager.h:288: error: uninitialized const 'irr::net::NULLRANGE'
make: *** [all_linux] Error 1

The first errors are no big deal (but anoying anyway), but the last two seem serious.

As you can see, i included irrnet as well as enet. To my project i only added:
#include <irrNet.h>
#define UNIX

Am i missing something to include? Or do i have to build irrnet/enet somehow before using it?

Posted: Sat Apr 14, 2007 4:13 am
by BlindSide
LOL You should define UNIX BEFORE including irrNet, but I think that is not the only problem, do this first then come back with the results I remember getting it to compile fine on linux not too long ago you just need to change some small things that G++ complains about.

Also you have "error: Irrlicht.h: No such file or directory " ?! Are you sure you set up your compiler correctly to detect irrlicht include directory?

OH I see the newly added frame ranges are causing a problem, try the previous version (0.35) from Midnights website http://midnight.shadowedlands.net/ OR

This is not gaurenteed to work but you can modify line 288 of NetManager.h

from

Code: Select all

static const SFrameRange NULLRANGE;
to

Code: Select all


static const SFrameRange NULLRANGE = {
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	0};
And it should work!

Very dodgy looking but it compiles, Im sticking the change up on SVN. I think this might fix monkey's problem too...

The MAXPATH thing shouldnt complain after you move defining linux before including irrnet, but if it still does just guess what kind of variable its supposed to be and declare it somewhere lol :P Personally I think it will just disappear when defining unix.

Posted: Sat Apr 14, 2007 1:52 pm
by MickeyKnox
BlindSide wrote:You should define UNIX BEFORE including irrNet
Ok, i changed this
BlindSide wrote:Also you have "error: Irrlicht.h: No such file or directory "
I changed it to irrlicht.h, g++ seems to be more choosy on these things, like the newline warnings
BlindSide wrote:This is not gaurenteed to work but you can modify line 288 of NetManager.h

from

Code: Select all

static const SFrameRange NULLRANGE;
to

Code: Select all


static const SFrameRange NULLRANGE = {
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	0};
And it should work!
It does!
BlindSide wrote:The MAXPATH thing shouldnt complain after you move defining linux before including irrnet, but if it still does just guess what kind of variable its supposed to be and declare it somewhere lol :P Personally I think it will just disappear when defining unix.
Unfortunately it doesnt!
BlindSide wrote:try the previous version (0.35) from Midnights website http://midnight.shadowedlands.net/
Version 0.35 entertaints me with even more compiler errors:

g++ -I../lib/irrlicht-1.3/include -I/usr/X11R6/include -I../lib/irrNet-0.35/ -I../lib/irrNet-0.35/enet/include -I../lib/irrNet-0.35/enet -O3 -ffast-math source/main.cpp source/RTSCamera.cpp -o tai -L/usr/X11R6/lib -L../lib/irrlicht-1.3/lib/Linux -lIrrlicht -lGL -lGLU -lXxf86vm -lXext -lX11
In file included from ../lib/irrNet-0.35/irrNet.h:4,
from source/main.cpp:4:
../lib/irrNet-0.35/NetManager.h:5:22: error: Irrlicht.h: No such file or directory
../lib/irrNet-0.35/NetManager.h:740:5: warning: no newline at end of file
In file included from ../lib/irrNet-0.35/irrNet.h:5,
from source/main.cpp:4:
../lib/irrNet-0.35/NetAnim.h:87:5: warning: no newline at end of file
In file included from source/main.cpp:4:
../lib/irrNet-0.35/irrNet.h:28:5: warning: no newline at end of file
../lib/irrNet-0.35/Packets.h:62: error: 'MAX_PATH' was not declared in this scope
../lib/irrNet-0.35/NetManager.h:562: error: default argument for parameter of type 'irr::core::vector3df&' has type 'irr::core::vector3df'
../lib/irrNet-0.35/NetManager.h:563: error: default argument for parameter of type 'irr::core::vector3df&' has type 'irr::core::vector3df'
../lib/irrNet-0.35/NetManager.h:564: error: default argument for parameter of type 'irr::core::vector3df&' has type 'irr::core::vector3df'
../lib/irrNet-0.35/NetManager.h:574: error: default argument for parameter of type 'irr::core::vector3df&' has type 'irr::core::vector3df'
../lib/irrNet-0.35/NetManager.h:575: error: default argument for parameter of type 'irr::core::vector3df&' has type 'irr::core::vector3df'
../lib/irrNet-0.35/NetManager.h:576: error: default argument for parameter of type 'irr::core::vector3df&' has type 'irr::core::vector3df'
make: *** [all_linux] Error 1

Posted: Sat Apr 14, 2007 3:03 pm
by BlindSide
Sweet so switch back to 0.36 and you've almost compiled it! All you gotta do now is stick

Code: Select all

#define MAX_PATH 255
at the top of Packets.h and you should be good to go.

Posted: Sun Apr 15, 2007 1:29 pm
by MickeyKnox
Alright, it compiles :)
Thank you

Posted: Thu May 10, 2007 10:42 pm
by BlindSide
Some exciting new things are happening at the irrnet SVN on sourceforge. (Search for irrNet in projects).

Version 0.40 will be out soon :D

Posted: Thu May 10, 2007 11:17 pm
by sio2

Code: Select all


static const SFrameRange NULLRANGE = {
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
	0};
Use "static const SFrameRange NULLRANGE = {};" and the struct will be initialised to zeros. This is part of the language spec.

Posted: Thu May 10, 2007 11:53 pm
by monkeycracks
It'd be really awesome if you added the capability to send a struct as a packet.