我刚刚在我的redhat enterprise linux 5.6上安装了QtSDK 1.2。在编译QT程序时,我遇到了以下错误:
[root@stack example1]# make
g++ -m64 -Wl,-O1 -Wl,-rpath,/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib -o example1 fac1.o -L/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib -lQtGui -lQtCore -lpthread
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtCore.so: undefined reference to `g_main_context_push_thread_default'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtCore.so: undefined reference to `inotify_init1@GLIBC_2.9'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `pipe2@GLIBC_2.9'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtCore.so: undefined reference to `g_main_context_pop_thread_default'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `FcFreeTypeQueryFace'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `FT_Library_SetLcdFilter'
/opt/QtSDK/Desktop/Qt/4.8.0/gcc/lib/libQtGui.so: undefined reference to `__longjmp_chk@GLIBC_2.11'
collect2: ld returned 1 exit status
make: *** [example1] Error 1
[root@stack example1]#
似乎g ++编译器使用所有正确的选项。因为我在rhel 5.6上安装了QtSDK 1.2,我已将libstdc ++。so.6.0.10复制到/ usr / lib64并将libstdc ++。so.6重新链接到libstdc ++。so.6.0.10,因为QtSDK在libstdc ++中需要GLIBCXX_3.4.9符号图书馆。我认为这可能是问题的根源。但我不确定。有什么建议吗?提前谢谢。
答案 0 :(得分:0)
我的回答是多个问题:
/usr/lib64