我有一个非常烦人的问题。
Linking CXX executable ../../bin/TheBdfhjkGame
cd /home/user/projekt/thebdfhjkgame-ipp/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/TheBdfhjkGame.dir/link.txt --verbose=1
/usr/bin/c++ CMakeFiles/TheBdfhjkGame.dir/eventReceiver.cpp.o \
CMakeFiles/TheBdfhjkGame.dir/main.cpp.o CMakeFiles/TheBdfhjkGame.dir/game.cpp.o \
CMakeFiles/TheBdfhjkGame.dir/window.cpp.o CMakeFiles/TheBdfhjkGame.dir/player.cpp.o \
CMakeFiles/TheBdfhjkGame.dir/object.cpp.o CMakeFiles/TheBdfhjkGame.dir/benny.cpp.o \
CMakeFiles/TheBdfhjkGame.dir/bullet.cpp.o CMakeFiles/TheBdfhjkGame.dir/base.cpp.o \
CMakeFiles/TheBdfhjkGame.dir/powerRelay.cpp.o CMakeFiles/TheBdfhjkGame.dir/ai.cpp.o \
CMakeFiles/TheBdfhjkGame.dir/qrc_systray.cxx.o \
CMakeFiles/TheBdfhjkGame.dir/__/include/moc_window.cxx.o -o ../../bin/TheBdfhjkGame \
-L/home/user/projekt/thebdfhjkgame-ipp/build/../lib -rdynamic \
/usr/lib/i386-linux-gnu/libXext.so.6 -Wl,-Bstatic -lSM -lICE -lX11 -lXext -lXxf86vm \
-lGLU -Wl,-Bdynamic -lGL -Wl,-Bstatic -lSM -lICE -lX11 -lXext -lz -lglut -lXmu -lXi \
-Wl,-Bdynamic -lQtGui -lQtCore -lBulletDynamics -lBulletCollision -lLinearMath \
-lIrrlicht -Wl,-Bstatic -lXxf86vm -lGLU -Wl,-Bdynamic -lGL -Wl,-Bstatic -lz -lglut \
-lXmu -lXi -Wl,-Bdynamic -lQtGui -lQtCore -lBulletDynamics -lBulletCollision \
-lLinearMath -lIrrlicht -Wl,-rpath,/home/user/projekt/thebdfhjkgame-ipp/build/../lib
/usr/bin/ld: /usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libGL.so: undefined reference to symbol 'XextAddDisplay'
/usr/bin/ld: note: 'XextAddDisplay' is defined in DSO /usr/lib/i386-linux-gnu/libXext.so.6 so try adding it to the linker command line
/usr/lib/i386-linux-gnu/libXext.so.6: could not read symbols: Incorrect operation
collect2: error: ld returned 1 exit status
值得注意的是,我使用过
-rdynamic /usr/lib/i386-linux-gnu/libXext.so.6
标志,但链接器要求我
'XextAddDisplay' 在 DSO /usr/lib/i386-linux-gnu/libXext.so.6 中定义,因此请尝试将其添加到链接器命令行
我该如何解决?makefile 是从 cmake 生成的。