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. [SOLVED] Qt v4.8.4 static build (Windows 7 x64): undefined reference to `pthread_testcancel'
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Qt v4.8.4 static build (Windows 7 x64): undefined reference to `pthread_testcancel'

Scheduled Pinned Locked Moved Installation and Deployment
5 Posts 2 Posters 3.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.
  • F Offline
    F Offline
    Fundaev
    wrote on last edited by
    #1

    Hi there!

    I've read a lot of articles about static build of Qt, and I faild to find somebody else, who are faced with the same problem.

    I downloaded Qt v4.8.4 and build it in according to "these instructions":http://qt-project.org/wiki/How_to_build_a_static_Qt_version_for_Windows_with_gcc.

    After that I created the simple Qt GUI project with only window, corrected the project file in according to the same instructions, added CONFIG+=STATIC additional qmake argument. But when I try to compile the project, the following error occurs on the linking step:

    @g++ -static -static-libgcc -Wl,-s -mthreads -Wl,-subsystem,windows -o release\Test1s.exe release/main.o release/mainwindow.o release/moc_mainwindow.o -L"e:\Distors\Programming\Qt\qt-everywhere-opensource-src-4.8.4\lib" -lmingw32 -lqtmain -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtCore -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lz
    e:\Distors\Programming\Qt\qt-everywhere-opensource-src-4.8.4\lib\libQtCore.a(qdatetime.o):qdatetime.cpp:(.text+0x35a8): undefined reference to `pthread_testcancel'@

    If somebody was faced with such problem, please, let me know how you fixed it.

    Thank you.

    P.S. I do not provide the source code, because it's default simple GUI project, created by QtCreator 2.7.0.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Fundaev
      wrote on last edited by
      #2

      ok, it was my typo: I specified in the QTDIR the path to Qt v5.x directory, instead of Qt v4.8.4.

      Corrected. But now when I try to coplite the project the following error occurs:

      @g++ -static -static-libgcc -Wl,-s -Wl,-subsystem,windows -o release\Test1s.exe release/main.o release/mainwindow.o release/moc_mainwindow.o -L"e:\Distors\Programming\Qt\qt-everywhere-opensource-src-4.8.4\lib" -lmingw32 -lqtmain -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtCore -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
      release/main.o:main.cpp:(.text+0x28): undefined reference to `QApplication::QApplication(int&, char**, int)'@

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        Did you do a clean before recompiling ? You might have now a mix of object linked to your two Qt

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • F Offline
          F Offline
          Fundaev
          wrote on last edited by
          #4

          Hi!

          Yes, sure.

          1 Reply Last reply
          0
          • F Offline
            F Offline
            Fundaev
            wrote on last edited by
            #5

            OK, I've fixed it. The problem was caused the in the different versions of MinGW for x32 and x64 architectures. It seems, QT v4.8.4 was complied by x64 MinGW and the project - by x64 one.

            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