Hi!
We recently updated the server (server is a big word, it's really just a desktop with Ubuntu that we access with ssh) on which we compile our code. Since the update my code won't compile. The linker is complaining about missing references from almost all .so that I'm linking from. It compiles on my own pc so I don't think it's the problem . Additional info :
The raw g++ command (it's quite long, sorry!) :
g++ -fPIC -O3 -DNDEBUG -I. -Igen -I../gflags-1.5/src -I../zlib-1.2.5 -DARCH_K8 -Wno-deprecated -I../protobuf-2.3.0/src -I../cbc-2.6.2/include -DUSE_CBC
-I../cbc-2.6.2/include -DUSE_CLP -I../glpk-4.45/include -DUSE_GLPK -Wl,-rpath /lib/x86_64-linux-gnu/ -L/lib/x86_64-linux-gnu/ -Wl,-rpath ../gflags-1.5/lib
-L../gflags-1.5/lib -lgflags -Wl,-rpath ../zlib-1.2.5/lib -L../zlib-1.2.5/lib -lz -Wl,-rpath ../protobuf-2.3.0/lib -L../protobuf-2.3.0/lib -lprotobuf -lpthread -lrt
objs/nqueensBenchmark.o objs/benchmarkTimer.o librouting.a libconstraint_solver.a libutil.a libbase.a -o bin/benchmark/nqueens
Some of the weirdest error message I get to show that there are linker errors with both standard libraries (librt, libpthread) and libraries specific to my program.
timer.cc:(.text+0x15d): undefined reference to `clock_gettime'
demon_profiler.pb.cc:(.text+0x6f3): undefined reference to `pthread_once'
assignment.pb.cc:(.text+0x2d80): undefined reference to `google::protobuf::Message::~Message()'
Versions
Ubuntu version : 11.10 (Oneiric Ocelot) 64 bit
GCC version : 4.6.1 (tried with 4.5.4 too)
Things I tried
- Adding "-Wl,-rpath /lib/x86_64-linux-gnu/ -L/lib/x86_64-linux-gnu/" to the compile command (since it's where librt is located)
- Using g++ 4.5.4 instead of 4.6.1
Any ideas?
Philippe Van Kessel