[Plib-users] linking trouble
Brought to you by:
sjbaker
From: Jos E. <je...@gm...> - 2005-04-27 19:59:45
|
Hi guys, I am trying to experiment with plibnet but can't manage to get it to work. My code (which just binds to a port, nothing else yet) compiles fine, but I can't manage to get it linked. Here's the top part of my output and command: [jos@u15178506 server]$ make g++ -lplibnet -lplibul -o server application.o main.o server.o server.o(.text+0x11): In function `CServer::CServer()': /home/jos/ts/server/server.cpp:7: undefined reference to `netInit()' server.o(.text+0x32):/home/jos/ts/server/server.cpp:9: undefined reference to `netSocket::netSocket()' server.o(.text+0x72):/home/jos/ts/server/server.cpp:11: undefined reference to `netSocket::open(bool)' (etc...) Thus, I already include plibnet and I do have a file called /usr/lib/libplibnet.a, but I nevertheless get undefined references. Any ideas? (My makefile is below) Thanks in advance! Jos EXECUTABLE =3D server CC =3D g++ CFLAGS =3D -Wall -W -pedantic -ggdb LFLAGS =3D -lplibnet -lplibul DFLAGS =3D -A -R -p -u -t -c -Q COMPILE =3D $(CC) $(CFLAGS) -c -g SRCS :=3D $(wildcard *.cpp) OBJS :=3D $(patsubst %.cpp,%.o,$(SRCS)) # Standard target: all: $(EXECUTABLE) # Main target: $(EXECUTABLE): $(OBJS) $(CC) $(LFLAGS) -o $(EXECUTABLE) $(OBJS) # All .cpp files have to be compiled to .o files: %.o: %.cpp $(COMPILE) -o $@ $< clean: -rm $(OBJS) $(EXECUTABLE) *~ autodoc.* |