[ENet-discuss] Library inclusion question

Jos Elkink jos at cantr.net
Thu Apr 29 13:06:35 PDT 2004


Hi all,

I'm a new user of enet and relatively inexperienced with C, so I'm a
little afraid I ask a really dumb question. But I can't figure out the
problem, so perhaps someone here can help.

My code compiles fine, but when I try to link, I get the following errors:

g++ -L/usr/lib -L/usr/local/lib -lenet -lglut -lGLU -lGL -lglpng -lcrypt
-lnsl -lm -o client client.o communicator.o configuration.o frontscreen.o
main.o mainwindow.o
communicator.o(.text+0x12): In function
`Communicator::Communicator[not-in-charge]()':
/home/jos/Cantr/new/client/communicator.cpp:5: undefined reference to
`enet_initialize'
communicator.o(.text+0xf2): In function
`Communicator::Communicator[in-charge]()':
/home/jos/Cantr/new/client/communicator.cpp:5: undefined reference to
`enet_initialize'
communicator.o(.text+0x1e2): In function `Communicator::~Communicator
[not-in-charge]()':
/home/jos/Cantr/new/client/communicator.cpp:13: undefined reference to
`enet_host_destroy'
communicator.o(.text+0x1e7):/home/jos/Cantr/new/client/communicator.cpp:16:
undefined reference to `enet_deinitialize'
communicator.o(.text+0x226): In function `Communicator::~Communicator
[in-charge]()':
/home/jos/Cantr/new/client/communicator.cpp:13: undefined reference to
`enet_host_destroy'

etc..

This is in a Debian Linux environment. There's no error that enet cannot
be found, so it does use the library - why do I still get those 'undefined
reference' errors? Or better, how do I get rid of them? :)

Thanks in advance for any help!

Jos




More information about the ENet-discuss mailing list