Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Linker error with crt on OS X
QtWS25 Last Chance

Linker error with crt on OS X

Scheduled Pinned Locked Moved Solved General and Desktop
linker errorsos xqmake makefile
4 Posts 2 Posters 2.6k Views
  • 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.
  • L Offline
    L Offline
    Lukas Woodtli
    wrote on last edited by
    #1

    I have a Qt Creator project (qmake) that contains a lot of C code (*.c files).
    I managed to compile the files. But linking is not working.
    The linker complains about crt1.10.6.o

    ld: library not found for -lcrt1.10.6.o
    

    The main part of the build output:

    11:56:01: Starte "/usr/bin/make" 
    /Users/Boot/Qt/5.5/clang_64/bin/qmake -spec macx-clang CONFIG+=debug CONFIG+=x86_64 -o Makefile ../QFreeRTOS/QFreeRTOS.pro
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -v -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.7 -Wl,-rpath,/Users/Boot/Qt/5.5/clang_64/lib -o QFreeRTOS main_blinky.o croutine.o event_groups.o list.o queue.o tasks.o timers.o port.o   -F/Users/Boot/Qt/5.5/clang_64/lib -framework QtCore -framework DiskArbitration -framework IOKit 
    Apple LLVM version 7.0.2 (clang-700.1.81)
    Target: x86_64-apple-darwin15.2.0
    Thread model: posix
     "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -headerpad_max_install_names -macosx_version_min 10.7.0 -o QFreeRTOS -lcrt1.10.6.o -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -rpath /Users/Boot/Qt/5.5/clang_64/lib main_blinky.o croutine.o event_groups.o list.o queue.o tasks.o timers.o port.o -framework QtCore -framework DiskArbitration -framework IOKit -lstdc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/lib/darwin/libclang_rt.osx.a -F/Users/Boot/Qt/5.5/clang_64/lib
    ld: library not found for -lcrt1.10.6.o
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    I'm on Mac OS X 10.11.2
    using Qt 5.5.0

    Thx

    1 Reply Last reply
    0
    • L Offline
      L Offline
      Lukas Woodtli
      wrote on last edited by
      #2

      I managed to fix this problem.
      There are two different aproaches:

      1. change qdevice.pri (<Qt_dir>/5.5/clang_64/mkspecs/qdevice.pri)
        add
      QMAKE_MAC_SDK = macosx10.11
      QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
      

      or
      2. Change project file (*.pro)
      add

      macx {
        # Build against latest platform SDK, deployable on OS X 10.8
        QMAKE_MAC_SDK = macosx10.11
        QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11
      }
      

      Cheers

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

        Hi and welcome to devnet,

        Glad you found out and thanks for sharing !

        Please mark the thread as solved using the "Topic Tool" button so that other forum users may know a solution has been found :)

        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
        • L Offline
          L Offline
          Lukas Woodtli
          wrote on last edited by
          #4

          Thank you for the hint about 'solved'.

          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