Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Can't successfully cross-compile MySQL: cannot find /lib/libpthread.so.0
Qt 6.12 LTS is out! See what's new in the release blog

Can't successfully cross-compile MySQL: cannot find /lib/libpthread.so.0

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 3 Posters 6.6k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello!

    I'm having serious problems while cross-compiling MySQL for Qt 4.7.4.
    The following error is thrown:
    @/usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../../arm-linux-gnueabi/bin/ld: skipping incompatible /lib/libpthread.so.0 when searching for /lib/libpthread.so.0
    /usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../../arm-linux-gnueabi/bin/ld: cannot find /lib/libpthread.so.0@

    My system:
    Host: Debian Lenny 5.0.9
    Compiler: arm-linux-gnueabi-gcc-4.3, arm-linux-gnueabi-g++-4.3
    Target: Debian Lenny

    What I did:

    I cross-compile the tslib to support the touchscreen.

    Changed the qmake.conf file.
    @include(../../common/g++.conf)
    include(../../common/linux.conf)
    include(../../common/qws.conf)
    QMAKE_INCDIR += /home/spiderman/Development/qt/tslib-1.0/tslib-ARM/include
    QMAKE_LIBDIR += /home/spiderman/Development/qt/tslib-1.0/tslib-ARM/lib
    QMAKE_LFLAGS += -lts
    QMAKE_CC = arm-linux-gnueabi-gcc-4.3
    QMAKE_CXX = arm-linux-gnueabi-g++-4.3
    QMAKE_LINK = arm-linux-gnueabi-g++-4.3
    QMAKE_LINK_SHLIB = arm-linux-gnueabi-g++-4.3
    QMAKE_AR = arm-linux-gnueabi-ar cqs
    QMAKE_OBJCOPY = arm-linux-gnueabi-objcopy
    QMAKE_STRIP = arm-linux-gnueabi-strip
    load(qt_config)@

    Executed configure:
    @./configure -embedded arm -xplatform qws/linux-arm-gnueabi-g++ -release -prefix /usr/local/Trolltech/Qt-target-version -qt-gfx-linuxfb -qt-kbd-tty -little-endian -host-little-endian@

    Cross-compiled and installed:
    @make
    sudo make install@

    Up to this point everything was okay, I can even cross-compile my own application and execute it on my target.
    But, as I need MySQL support, I tried to compile the plugin.

    First, I installed the required packes on the target:
    @apt-get install libmysqlclient15-dev@

    Then I cross-compiled the plugin, whereby <TargetRFS> is the path to the target filesystem, where mysql (libmysqlclient15-dev) was installed:
    @cd Qt-target-version/src/plugins/sqldrivers/mysql
    /usr/local/Trolltech/Qt-target-version/bin/qmake -o Makefile "INCLUDEPATH+=<TargetRFS>/usr/include/mysql" "LIBS+=-L<TargetRFS>/usr/lib -lmysqlclient_r" mysql.pro
    make@

    The library and the header file are definitely available on the target.

    During make the following error is thrown:

    @arm-linux-gnueabi-g++ -Wl,-rpath-link,/home/spiderman/Development/qt/Qt-target-version/lib -lts -Wl,-O1 -Wl,-rpath,/usr/local/Trolltech/Qt-target-version/lib -Wl,-rpath,/usr/local/Trolltech/Qt-target-version/lib -shared -o libqsqlmysql.so .obj/release-shared-emb-arm/main.o .obj/release-shared-emb-arm/qsql_mysql.o .obj/release-shared-emb-arm/moc_qsql_mysql.o -L/home/spiderman/Development/qt/Qt-target-version/lib -L/home/spiderman/Development/qt/tslib-1.0/tslib-ARM/lib -L/home/spiderman/Development/rootfs/debian_lenny/usr/lib/ -lmysqlclient_r -lQtSql -L/home/spiderman/Development/qt/Qt-target-version/lib -L/home/spiderman/Development/qt/tslib-1.0/tslib-ARM/lib -lQtCore -lpthread
    /usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../../arm-linux-gnueabi/bin/ld: skipping incompatible /lib/libpthread.so.0 when searching for /lib/libpthread.so.0
    /usr/lib/gcc/arm-linux-gnueabi/4.3.2/../../../../arm-linux-gnueabi/bin/ld: cannot find /lib/libpthread.so.0
    collect2: ld returned 1 exit status
    make: *** [../../../../plugins/sqldrivers/libqsqlmysql.so] Error 1@

    Why can't the system find libpthread? Must there be installed additional packes on the target or host? Can the compiler version be the problem? Why does the compiling of Qt itself and tslib work but not MySQL?

    Thanks a lot for your help!!!

    Regards,
    Roony

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi,I also met the problem when I was working on a project.Have u solved it? Please tell me how did it, THX.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        manolia
        wrote on last edited by
        #3

        Has anyone solved this problem? Im having crosscompile issues with MySQL on beaglebone black

        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
        • Unsolved