Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved Linker error with crt on OS X

    General and Desktop
    linker errors os x qmake makefile
    2
    4
    2197
    Loading More Posts
    • 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
      Lukas Woodtli last edited by

      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 Reply Quote 0
      • L
        Lukas Woodtli last edited by

        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 Reply Quote 0
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          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 Reply Quote 0
          • L
            Lukas Woodtli last edited by

            Thank you for the hint about 'solved'.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post