Symbol lookup error (linux - c++)

2019-07-05 05:43发布

问题:

i'm working on multi-agent system like Robocup soccerrSim2d On Gnu-linux . My distb is Ubuntu 11.10(kernel 3.2 - gcc 4.6 )

I installed librcsc from source . (it compiled and installed successfully)

then I installed agent2d from src . (it compiled and installed successfully too !)

But there is a problem with running the agent2d code : (when I run src/start.sh : )

this Error happens :

./src/sample_player: symbol lookup error: /usr/local/lib/librcsc_agent.so.7: undefined symbol: _ZN4rcsc9UDPSocketC1EPKci

What do you think about it guys? Actually, when does "Symbol lookup Error " happen?

回答1:

Running that symbol through c++filt shows that it is rcsc::UDPSocket::UDPSocket(char const*, int).

Since that is, indeed, part of rcsc, you need to take a look at ldd /usr/local/lib/librcsc_agent.so.7. The entry for librcsc.so.X (for some number X) there probably says "not found". You must locate the appropriate library (including the numeric suffix that ldd said was being searched for) and add the directory containing it to the LD_LIBRARY_PATH environment variable in the start.sh script.