有谁编译过qt webengine无法编译
答案:1 悬赏:50 手机版
解决时间 2021-02-14 19:57
- 提问者网友:温旧梦泪无声
- 2021-02-14 15:57
有谁编译过qt webengine无法编译
最佳答案
- 五星知识达人网友:拜訪者
- 2021-02-14 16:41
[wanglj@localhost testQT]$ make
g++ -o testQT main.o -L/opt/Qt5.1.1/5.1.1/gcc_64/lib -lqt-mt -lXext -lX11 -lm
main.o: In function `main':
/home/wanglj/testQT/main.cpp:6: undefined reference to `QApplication::QApplication(int&, char**, int)'
main.o: In function `QString':
/usr/include/QtCore/qstring.h:413: undefined reference to `QString::fromAscii_helper(char const*, int)'
main.o: In function `main':
/home/wanglj/testQT/main.cpp:7: undefined reference to `QLabel::QLabel(QString const&, QWidget*, QFlags<Qt::WindowType>)'
main.o: In function `~QString':
/usr/include/QtCore/qstring.h:869: undefined reference to `QString::free(QString::Data*)'
/usr/include/QtCore/qstring.h:869: undefined reference to `QString::free(QString::Data*)'
collect2: ld 返回 1
make: *** [testQT] 错误 1
但若直接用 qtcreator 打开编译,则无错误
并且find -name libqt-mt* 也找不到其他版本的该文件
用qtcreator编译好的可执行文件,也找不到连接该lib文件
[wanglj@localhost build-testQT-桌面-Debug]$ ldd testQT
linux-vdso.so.1 => (0x00007fff4ddff000)
libQtGui.so.4 => /usr/lib64/libQtGui.so.4 (0x000000397f000000)
libQtCore.so.4 => /usr/lib64/libQtCore.so.4 (0x000000397ea00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003978600000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fda6a081000)
libm.so.6 => /lib64/libm.so.6 (0x0000003977a00000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003983a00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003977e00000)
libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x000000397a600000)
librt.so.1 => /lib64/librt.so.1 (0x0000003978e00000)
libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x0000003979200000)
libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x000000397be00000)
libz.so.1 => /lib64/libz.so.1 (0x0000003978a00000)
libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x000000397ba00000)
libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x0000003979e00000)
libSM.so.6 => /usr/lib64/libSM.so.6 (0x0000003985a00000)
libICE.so.6 => /usr/lib64/libICE.so.6 (0x0000003984e00000)
libXi.so.6 => /usr/lib64/libXi.so.6 (0x000000397ce00000)
libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x000000397d600000)
libXrandr.so.2 => /usr/lib64/libXrandr.so.2 (0x000000397de00000)
libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x000000397da00000)
libXcursor.so.1 => /usr/lib64/libXcursor.so.1 (0x000000397e200000)
libXinerama.so.1 => /usr/lib64/libXinerama.so.1 (0x000000397e600000)
libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x000000397d200000)
libXext.so.6 => /usr/lib64/libXext.so.6 (0x000000397c600000)
libX11.so.6 => /usr/lib64/libX11.so.6 (0x000000397b600000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003978200000)
/lib64/ld-linux-x86-64.so.2 (0x0000003977600000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x0000003983600000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x000000397c200000)
libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x000000397ae00000)
libXau.so.6 => /usr/lib64/libXau.so.6 (0x000000397aa00000)
------解决方案--------------------
INCPATH = -I/usr/lib64/qt-3.3/mkspecs/default -I. -I. -I$(QTDIR)/include
这一行看上去你调用的qmake不是5.1.1的。试试指定完整路径运行qmake
/opt/Qt5.1.1/5.1.1/gcc_64/bin/qmake testQT.pro
g++ -o testQT main.o -L/opt/Qt5.1.1/5.1.1/gcc_64/lib -lqt-mt -lXext -lX11 -lm
main.o: In function `main':
/home/wanglj/testQT/main.cpp:6: undefined reference to `QApplication::QApplication(int&, char**, int)'
main.o: In function `QString':
/usr/include/QtCore/qstring.h:413: undefined reference to `QString::fromAscii_helper(char const*, int)'
main.o: In function `main':
/home/wanglj/testQT/main.cpp:7: undefined reference to `QLabel::QLabel(QString const&, QWidget*, QFlags<Qt::WindowType>)'
main.o: In function `~QString':
/usr/include/QtCore/qstring.h:869: undefined reference to `QString::free(QString::Data*)'
/usr/include/QtCore/qstring.h:869: undefined reference to `QString::free(QString::Data*)'
collect2: ld 返回 1
make: *** [testQT] 错误 1
但若直接用 qtcreator 打开编译,则无错误
并且find -name libqt-mt* 也找不到其他版本的该文件
用qtcreator编译好的可执行文件,也找不到连接该lib文件
[wanglj@localhost build-testQT-桌面-Debug]$ ldd testQT
linux-vdso.so.1 => (0x00007fff4ddff000)
libQtGui.so.4 => /usr/lib64/libQtGui.so.4 (0x000000397f000000)
libQtCore.so.4 => /usr/lib64/libQtCore.so.4 (0x000000397ea00000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003978600000)
libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007fda6a081000)
libm.so.6 => /lib64/libm.so.6 (0x0000003977a00000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003983a00000)
libc.so.6 => /lib64/libc.so.6 (0x0000003977e00000)
libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x000000397a600000)
librt.so.1 => /lib64/librt.so.1 (0x0000003978e00000)
libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x0000003979200000)
libpng12.so.0 => /usr/lib64/libpng12.so.0 (0x000000397be00000)
libz.so.1 => /lib64/libz.so.1 (0x0000003978a00000)
libfreetype.so.6 => /usr/lib64/libfreetype.so.6 (0x000000397ba00000)
libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x0000003979e00000)
libSM.so.6 => /usr/lib64/libSM.so.6 (0x0000003985a00000)
libICE.so.6 => /usr/lib64/libICE.so.6 (0x0000003984e00000)
libXi.so.6 => /usr/lib64/libXi.so.6 (0x000000397ce00000)
libXrender.so.1 => /usr/lib64/libXrender.so.1 (0x000000397d600000)
libXrandr.so.2 => /usr/lib64/libXrandr.so.2 (0x000000397de00000)
libXfixes.so.3 => /usr/lib64/libXfixes.so.3 (0x000000397da00000)
libXcursor.so.1 => /usr/lib64/libXcursor.so.1 (0x000000397e200000)
libXinerama.so.1 => /usr/lib64/libXinerama.so.1 (0x000000397e600000)
libfontconfig.so.1 => /usr/lib64/libfontconfig.so.1 (0x000000397d200000)
libXext.so.6 => /usr/lib64/libXext.so.6 (0x000000397c600000)
libX11.so.6 => /usr/lib64/libX11.so.6 (0x000000397b600000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003978200000)
/lib64/ld-linux-x86-64.so.2 (0x0000003977600000)
libuuid.so.1 => /lib64/libuuid.so.1 (0x0000003983600000)
libexpat.so.1 => /lib64/libexpat.so.1 (0x000000397c200000)
libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x000000397ae00000)
libXau.so.6 => /usr/lib64/libXau.so.6 (0x000000397aa00000)
------解决方案--------------------
INCPATH = -I/usr/lib64/qt-3.3/mkspecs/default -I. -I. -I$(QTDIR)/include
这一行看上去你调用的qmake不是5.1.1的。试试指定完整路径运行qmake
/opt/Qt5.1.1/5.1.1/gcc_64/bin/qmake testQT.pro
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯