Re: [Plib-users] linking trouble
Brought to you by:
sjbaker
From: Frederic B. <fre...@fr...> - 2005-04-28 14:38:53
|
Because it solves unresolved symbols introduced by an argument by looking sequentially in the remainder of the command line, instead of rewinding t= he command line ? -Fred Quoting Jos Elkink: > Thank you - that solves it! :) I can't say I understand why, but I'm > happy enough ... > > Jos > > On 4/28/05, Frederic Bouvier <fre...@fr...> wrote: > > 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 t= o > > > work. My code (which just binds to a port, nothing else yet) compil= es > > > fine, but I can't manage to get it linked. Here's the top part of m= y > > > 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.* |