jeudi 27 avril 2017

g++ linker error despite specifying the lib files

I am trying to compile Zeroc ICE demo program.

at the time of linking, i get multiple undefined reference errors.

/Clock.cpp:71: undefined reference to ` IceInternal::Outgoing::Outgoing(IceProxy::Ice::Object*, std::__cxx11::basic_string, std::allocator > const&, Ice::OperationMode, std::map, std::allocator >, std::__cxx11::basic_string, std::allocator >, std::less, std::allocator > >, std::allocator, std::allocator > const, std::__cxx11::basic_string, std::allocator > > > > const*)'

I tried the following to diagnose the issue:

Change the order of lib reference in g++ command (source cpp then -l): g++ -std=c++11 Clock.cpp -lpthread -lIce -lIceUtil -lIceStorm but no help.

Further, I tried to see if the referred lib files contain the reported symbols. I ran objdump -TC libIce.so to see: `00000000001f53d0 g DF .text 000000000000141c Base IceInternal::Outgoing::Outgoing(IceProxy::Ice::Object*, std::string const&, Ice::OperationMode, std::map, std::allocator > > const*)

00000000001f53d0 g DF .text 000000000000141c Base IceInternal::Outgoing::Outgoing(IceProxy::Ice::Object*, std::string const&, Ice::OperationMode, std::map, std::allocator > > const*) `

I use g++(GCC) 6.2.0.

Could anyone help please.

Aucun commentaire:

Enregistrer un commentaire