# 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 on other sites
I'm not sure about this one but isn't LFLAGS supposed to be LDFLAGS?

PS. Remember to post any error messages you get.

##### 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 on other sites
I am pretty sure that there should not be a space between the -l and the library name...

##### Share on other sites
tried with and without and no luck :(

any other ideas?

##### Share on other sites
Quote:
 Original post by philderbeasttried 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 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]

## 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

• ### Forum Statistics

• Total Topics
628281
• Total Posts
2981800

• 10
• 11
• 17
• 14
• 9