【问题标题】:Undefined reference to functions in xlib.h while compiling Qt-Everywhere 4.6.3编译 Qt-Everywhere 4.6.3 时对 xlib.h 中函数的未定义引用
【发布时间】:2013-09-04 05:33:56
【问题描述】:

我正在 Ubuntu 12.04.1 32 位上编译 Qt-Everywhere 4.6.3 以在 mini2440 上使用。我能够为 mini2440 编译 qmake 但未能为我的笔记本电脑编译以进行测试。 ./configure 没有给我任何错误(我必须安装 libx11-devlibXext-dev 才能这样做)。但是在运行make 时,我遇到了许多链接器错误,例如:

.obj/release-shared/qpaintengine_x11.o:在函数“QX11PaintEngine::drawPixmap(QRectF const&, QPixmap const&, QRectF const&)”中:
qpaintengine_x11.cpp:(.text+0x25fb): 未定义对“XCopyArea”的引用
qpaintengine_x11.cpp:(.text+0x264c): 对“XSetClipOrigin”的未定义引用
qpaintengine_x11.cpp:(.text+0x2691): 未定义对“XSetClipMask”的引用
qpaintengine_x11.cpp:(.text+0x2723): 未定义对“XCopyArea”的引用
qpaintengine_x11.cpp:(.text+0x2871): 未定义对“XSetClipRectangles”的引用
qpaintengine_x11.cpp:(.text+0x28bf): 未定义对“XCreatePixmap”的引用
qpaintengine_x11.cpp:(.text+0x28e2): 未定义对“XCreateGC”的引用
qpaintengine_x11.cpp:(.text+0x28fd): 未定义对“XSetForeground”的引用
qpaintengine_x11.cpp:(.text+0x2934): 未定义对“XFillRectangle”的引用
qpaintengine_x11.cpp:(.text+0x2989): 未定义对“XSetClipRectangles”的引用
qpaintengine_x11.cpp:(.text+0x29dc): 未定义对“XCopyArea”的引用
qpaintengine_x11.cpp:(.text+0x29ef): 未定义对“XFreeGC”的引用
qpaintengine_x11.cpp:(.text+0x2a0c): 未定义对“XSetClipMask”的引用
qpaintengine_x11.cpp:(.text+0x2a31): 未定义对“XSetClipOrigin”的引用
qpaintengine_x11.cpp:(.text+0x2a44): 未定义对“XFreePixmap”的引用
qpaintengine_x11.cpp:(.text+0x2ab4): 未定义对“XSetForeground”的引用
qpaintengine_x11.cpp:(.text+0x2b16): 未定义对“XCreateGC”的引用
qpaintengine_x11.cpp:(.text+0x2b31): 对“XSetForeground”的未定义引用
qpaintengine_x11.cpp:(.text+0x2b70): 未定义对“XFillRectangle”的引用
qpaintengine_x11.cpp:(.text+0x2b8b): 对“XSetBackground”的未定义引用
qpaintengine_x11.cpp:(.text+0x2ba6): 对“XSetForeground”的未定义引用
qpaintengine_x11.cpp:(.text+0x2be8): 未定义对“XSetFillStyle”的引用
qpaintengine_x11.cpp:(.text+0x2c0f): 未定义对“XSetTSOrigin”的引用
qpaintengine_x11.cpp:(.text+0x2c30): 未定义对“XSetStipple”的引用
qpaintengine_x11.cpp:(.text+0x2c6f): 未定义对“XFillRectangle”的引用
qpaintengine_x11.cpp:(.text+0x2c82): undefined reference to `XFreeGC'
qpaintengine_x11.cpp:(.text+0x2ca7): 未定义对“XSetClipOrigin”的引用
qpaintengine_x11.cpp:(.text+0x2ccc): 未定义对“XSetClipMask”的引用
qpaintengine_x11.cpp:(.text+0x2d26): 未定义对“XCreateGC”的引用
qpaintengine_x11.cpp:(.text+0x2d51): 对“XSetBackground”的未定义引用
qpaintengine_x11.cpp:(.text+0x2d6c): 对“XSetForeground”的未定义引用
qpaintengine_x11.cpp:(.text+0x2da3): 未定义对“XFillRectangle”的引用
qpaintengine_x11.cpp:(.text+0x2db6): 未定义对“XFreeGC”的引用
qpaintengine_x11.cpp:(.text+0x2ddd): 未定义对“XSetClipMask”的引用
qpaintengine_x11.cpp:(.text+0x2e0a): 未定义对“XSetClipOrigin”的引用
qpaintengine_x11.cpp:(.text+0x2e81): 对“XSetForeground”的未定义引用
qpaintengine_x11.cpp:(.text+0x2ebc): 未定义对“XFillRectangle”的引用
qpaintengine_x11.cpp:(.text+0x2f07): 未定义对“XSetClipRectangles”的引用
qpaintengine_x11.cpp:(.text+0x2fa3): 未定义对“XCopyArea”的引用

我不知道出了什么问题。我的配置选项是:

ved@ubuntu:~/qt-src/qt-everywhere-opensource-src-4.6.3$ ./configure -prefix /qt-test -release -shared -fast -pch -no-qt3support -qt-sql -sqlite -no-libtiff -no-libmng -qt-libjpeg -qt-zlib -qt-libpng -qt-freetype -no-openssl -nomake 示例 -nomake 演示 -nomake 工具 -optimized-qmake -no-phonon -no- nis -no-opengl -no-cups -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-xkb -no-sm -no-xinerama -no-xshape -no-separate-debug-info -深度 16 -no-qvfb -qt-gfx-linuxfb -no-gfx-qvfb -no-kbd-qvfb -no-mouse-qvfb-qt-kbd-usb -confirm-license -verbose

我复制了与 mini2440 版本相同的选项(-xplatform qws/linux-arm-g++-embedded arm 除外)。

【问题讨论】:

  • 您的笔记本电脑上安装的是哪个操作系统?一个桌面 Linux 发行版??
  • @UmNyobe 我使用 Ubuntu 12.04 32 位。

标签: qt compilation linker g++


【解决方案1】:

如果您使用的是桌面 Linux 发行版,请按照 x11 requirements page 上的说明进行操作。除了 libx11-dev 和 libXext-dev 你还需要:

  • libfontconfig1-dev
  • libfreetype6-dev
  • libxcursor-dev
  • libxfixes-dev
  • libxft-dev
  • libxi 开发
  • libxrandr-dev
  • libxrender-dev

【讨论】:

  • 我在配置选项中包含了-no-xcursor -no-xfixes -no-xrandr -no-xrender -no-xkb -no-sm -no-xinerama -no-xshape。我需要删除它们并添加它们的支持吗?
猜你喜欢
  • 1970-01-01
  • 2012-06-12
  • 2012-08-16
  • 2023-03-10
  • 2017-11-11
  • 2016-04-25
  • 2016-01-09
  • 2012-01-10
  • 2010-12-05
相关资源
最近更新 更多