Re: [Plib-users] linking trouble
Brought to you by:
sjbaker
From: Frederic B. <fre...@fr...> - 2005-04-28 08:14:00
|
the linker may be sensible to parameter order. Try : g++ application.o main.o server.o -o server -lplibnet -lplibul -Fred Quoting Jos Elkink: > 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.* > > > ------------------------------------------------------- > SF.Net email is sponsored by: Tell us your software development plans! > Take this survey and enter to win a one-year sub to SourceForge.net > Plus IDC's 2005 look-ahead and a copy of this survey > Click here to start! http://www.idcswdc.com/cgi-bin/survey?id=105hix > _______________________________________________ > plib-users mailing list > pli...@li... > https://lists.sourceforge.net/lists/listinfo/plib-users > |