Sign in to follow this  
philderbeast

enet linking issues

Recommended Posts

for a lack of somewhere better to put this i will go for it here. I have just started making my own MMORPG engine on which to build a game I have in mind if it ever gets that far. after a couple of false starts in finding libraries that suit my skil level i have some down to using enet for my networking, now its all working nicely but i cant get it to like properly on my FreeBSD testing box as im planning to use this OS to run my server off if it ever gets that far. so far I have it compiling on windows (its all cross platform so far :)) so i know the code itself is working so I'm presuming its an error in my Makefile this is the make file I'm attempting to use. all the other librarys are linking properly and i have made sure that libenet.a is in the /usr/local/lib folder so im a bit stummped code: CFLAGS=-I /usr/local/include/mysql/ -I /usr/local/include/mysql++/ -I /usr/local/include/ LFLAGS=-L /usr/local/lib/ -l boost_thread-gcc42-mt -l boost_system-gcc42-mt -l mysqlpp -l enet server: chat.o user.o main.o $(CC) $(LFLAGS) chat.o user.o main.o -o server chat.o: chat.h main.o: user.h chat.h clean: rm -f main.o chat.o user.o any suggestions are welcome and ill try them at least once :) thanks in advance.

Share this post


Link to post
Share on other sites
LFLAGS is a macro I made up not knowing one to use that was already made so that's fine and works properly.

the errors are as follows from the linking.

cc -L /usr/local/lib/ -l boost_thread-gcc42-mt -l boost_system-gcc42-mt -l mysqlpp -l enet chat.o user.o main.o -o server
chat.o(.text+0x1a8): In function `chat::chat()':
: undefined reference to `enet_initialize'
chat.o(.text+0x1e9): In function `chat::chat()':
: undefined reference to `enet_deinitialize'
chat.o(.text+0x21e): In function `chat::chat()':
: undefined reference to `enet_host_create'
chat.o(.text+0x271): In function `chat::chat()':
: undefined reference to `enet_host_service'
chat.o(.text+0x2f1): In function `chat::chat()':
: undefined reference to `enet_packet_destroy'
chat.o(.text+0x328): In function `chat::chat()':
: undefined reference to `enet_initialize'
chat.o(.text+0x369): In function `chat::chat()':
: undefined reference to `enet_deinitialize'
chat.o(.text+0x39e): In function `chat::chat()':
: undefined reference to `enet_host_create'
chat.o(.text+0x3f1): In function `chat::chat()':
: undefined reference to `enet_host_service'
chat.o(.text+0x471): In function `chat::chat()':
: undefined reference to `enet_packet_destroy'
*** Error code 1

Share this post


Link to post
Share on other sites
Quote:
Original post by philderbeast
tried with and without and no luck :(
any other ideas?
Try the following:
CXXFLAGS = -I/usr/local/include/mysql/ -I/usr/local/include/mysql++/ -I/usr/local/include/
LDFLAGS = -L/usr/local/lib/ -lboost_thread-gcc42-mt -lboost_system-gcc42-mt -lmysqlpp -lenet

Share this post


Link to post
Share on other sites
no change :( with that.

i tried reinstalling enet in case something went wrong but that didn't help either (used ports rather than just the source dl).

this is getting rather frustrating...

it seems like there is another library I must need but I have no idea what :S

ecit: apparently -lenet needs to be the last thing on the comandline...

thanks for the help guys

[Edited by - philderbeast on October 11, 2008 8:04:59 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this