Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Link error while building Qt 5.1.1 on Linux

Link error while building Qt 5.1.1 on Linux

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 2 Posters 5.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    reddish
    wrote on last edited by
    #1

    Hi all,

    I am trying to build the 5.1.1 source tarball on Debian GNU/Linux, using g++ 4.8.2. The make step fails on a linker error:

    make[5]: Entering directory /home/sidney/MyQt/qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/offscreen' rm -f libqoffscreen.so g++ -Wl,--no-undefined -Wl,-O1 -Wl,-rpath,/home/sidney/MyQt/root-5.1.1/lib -Wl,-rpath-link,/home/sidney/MyQt/qt-everywhere-opensource-src-5.1.1/qtbase/lib -shared -o libqoffscreen.so .obj/release-shared/main.o .obj/release-shared/qoffscreenintegration.o .obj/release-shared/qoffscreenwindow.o .obj/release-shared/qoffscreencommon.o .obj/release-shared/qoffscreenintegration_x11.o -L/home/sidney/MyQt/qt-everywhere-opensource-src-5.1.1/qtbase/lib -lQt5PlatformSupport -pthread -lgthread-2.0 -lglib-2.0 -lz -lQt5DBus -lQt5Gui -lQt5Core -lGL -lpthread .obj/release-shared/qoffscreenintegration_x11.o: In function QOffscreenX11GLXContext::~QOffscreenX11GLXContext()':
    qoffscreenintegration_x11.cpp:(.text+0x7b): undefined reference to XDestroyWindow' .obj/release-shared/qoffscreenintegration_x11.o: In function QOffscreenX11GLXContext::makeCurrent(QPlatformSurface*)':
    qoffscreenintegration_x11.cpp:(.text+0x129): undefined reference to XResizeWindow' qoffscreenintegration_x11.cpp:(.text+0x140): undefined reference to XSync'
    .obj/release-shared/qoffscreenintegration_x11.o: In function createDummyWindow(QOffscreenX11Info*, XVisualInfo*) [clone .isra.7]': qoffscreenintegration_x11.cpp:(.text+0x1e9): undefined reference to XCreateColormap'
    qoffscreenintegration_x11.cpp:(.text+0x276): undefined reference to XCreateWindow' qoffscreenintegration_x11.cpp:(.text+0x287): undefined reference to XFreeColormap'
    .obj/release-shared/qoffscreenintegration_x11.o: In function QOffscreenX11Connection::QOffscreenX11Connection()': qoffscreenintegration_x11.cpp:(.text+0x2e1): undefined reference to XInitThreads'
    qoffscreenintegration_x11.cpp:(.text+0x2fd): undefined reference to XOpenDisplay' .obj/release-shared/qoffscreenintegration_x11.o: In function QOffscreenX11Connection::~QOffscreenX11Connection()':
    qoffscreenintegration_x11.cpp:(.text+0x358): undefined reference to XCloseDisplay' .obj/release-shared/qoffscreenintegration_x11.o: In function QOffscreenX11GLXContext::QOffscreenX11GLXContext(QOffscreenX11Info*, QOpenGLContext*)':
    qoffscreenintegration_x11.cpp:(.text+0x462): undefined reference to qglx_findConfig(_XDisplay*, int, QSurfaceFormat const&, int)' qoffscreenintegration_x11.cpp:(.text+0x4b8): undefined reference to qglx_surfaceFormatFromGLXFBConfig(QSurfaceFormat*, _XDisplay*, __GLXFBConfigRec*, __GLXcontextRec*)'
    qoffscreenintegration_x11.cpp:(.text+0x4f1): undefined reference to XFree' qoffscreenintegration_x11.cpp:(.text+0x522): undefined reference to qglx_findVisualInfo(_XDisplay*, int, QSurfaceFormat*)'
    qoffscreenintegration_x11.cpp:(.text+0x579): undefined reference to XFree' .obj/release-shared/qoffscreenintegration_x11.o: In function QOffscreenX11Integration::createPlatformOpenGLContext(QOpenGLContext*) const':
    qoffscreenintegration_x11.cpp:(.text+0x6fd): undefined reference to XCloseDisplay' .obj/release-shared/qoffscreenintegration_x11.o: In function QOffscreenX11Integration::~QOffscreenX11Integration()':
    qoffscreenintegration_x11.cpp:(.text._ZN24QOffscreenX11IntegrationD2Ev[_ZN24QOffscreenX11IntegrationD5Ev]+0x20): undefined reference to XCloseDisplay' .obj/release-shared/qoffscreenintegration_x11.o: In function QOffscreenX11Integration::~QOffscreenX11Integration()':
    qoffscreenintegration_x11.cpp:(.text._ZN24QOffscreenX11IntegrationD0Ev[_ZN24QOffscreenX11IntegrationD0Ev]+0x21): undefined reference to XCloseDisplay' collect2: error: ld returned 1 exit status make[5]: *** [../../../../plugins/platforms/libqoffscreen.so] Error 1 make[5]: Leaving directory /home/sidney/MyQt/qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms/offscreen'
    make[4]: *** [sub-offscreen-make_first] Error 2
    make[4]: Leaving directory /home/sidney/MyQt/qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins/platforms' make[3]: *** [sub-platforms-make_first] Error 2 make[3]: Leaving directory /home/sidney/MyQt/qt-everywhere-opensource-src-5.1.1/qtbase/src/plugins'
    make[2]: *** [sub-plugins-make_first] Error 2
    make[2]: Leaving directory /home/sidney/MyQt/qt-everywhere-opensource-src-5.1.1/qtbase/src' make[1]: *** [sub-src-make_first] Error 2 make[1]: Leaving directory /home/sidney/MyQt/qt-everywhere-opensource-src-5.1.1/qtbase'
    make: *** [module-qtbase-make_first] Error 2

    It seems that there is an actual dependency on Xlib that somehow fails to make it into the Makefile.

    Is there an easy fix?

    Sidney

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Yes, you have missing dependencies. Please go through the list "here":http://qt-project.org/wiki/Building_Qt_5_from_Git it provides all apt-get instructions you need to run before compiling Qt.

      (Z(:^

      1 Reply Last reply
      0
      • R Offline
        R Offline
        reddish
        wrote on last edited by
        #3

        Thank you, I will look into that.

        However, shouldn't the configure script discover and report missing dependencies on my system?
        As a long-time unix user, this is what I would expect.

        As it is now, I have no easy way to find out exactly which library or header file is missing. The reported link error suggests that a few very basic symbols residing in libX11 cannot be found, but the libX11-dev package is installed on my system -- it's just that -lX11 is not included in the link line for some reason.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Indeed, problems with X should have been discovered by configure. Qt does check for a ton of things in configure, though, maybe it somehow failed on your particular setup.

          I'm a bit surprised it's building the offscreen plugin. Are you passing any arcane switches to configure?

          (Z(:^

          1 Reply Last reply
          0
          • R Offline
            R Offline
            reddish
            wrote on last edited by
            #5

            Hi sierdzo,

            Nothing weird, I just pass "-prefix" and "-opensource" options.

            Now that I installed a slew of xcb packages (I am puzzled why the Debian maintainers elected to split that up in 40-odd packages... but I digress), 5.1.1 builds without issue.

            Buiding 5.2.0-beta1 succeeds without a hitch, and it also built earlier when the xcb*dev packages where not installed. So it may be that this particular dependency issue was solved between 5.1 and 5.2.

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              Could be, 5.2 brings in really a ton of updates. Anyway, I'm glad it helped you. Happy coding :)

              (Z(:^

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved