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. Undefined symbols for architecture x86_64 - Linker error when building webrtc Qt for Mac
QtWS25 Last Chance

Undefined symbols for architecture x86_64 - Linker error when building webrtc Qt for Mac

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 2.4k 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.
  • D Offline
    D Offline
    Denys Yamkovyi
    wrote on last edited by
    #1

    I’m trying to make a build for Mac desktiop in Qt Creator using WebRTC native library but always see the error message:

    Undefined symbols for architecture x86_64:
    "_NSOSStatusErrorDomain", referenced from:
    rtc::DescriptionFromOSStatus(int) in libwebrtc.a(logging_mac.o)
    "OBJC_CLASS$_NSError", referenced from:
    objc-class-ref in libwebrtc.a(logging_mac.o)
    "OBJC_CLASS$_NSObject", referenced from:
    objc-class-ref in libwebrtc.a(thread_darwin.o)
    "OBJC_CLASS$_NSThread", referenced from:
    objc-class-ref in libwebrtc.a(thread_darwin.o)
    "_objc_autoreleasePoolPop", referenced from:
    (anonymous namespace)::InitCocoaMultiThreading() in libwebrtc.a(thread_darwin.o)
    rtc::Thread::PreRun(void*) in libwebrtc.a(thread_darwin.o)
    rtc::Thread::ProcessMessages(int) in libwebrtc.a(thread_darwin.o) ….
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [lib*******_WebRTCWrapper.1.0.0.dylib] Error 1
    12:17:39: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project (kit: Desktop Qt 5.10.0 clang 64bit)
    When executing step "Make"

    Initial parameters:

    Qt Creator Based on Qt 5.10.0 (Clang 7.0 (Apple), 64 bit)
    Compiler - Clang (C++ x86 64 bit) in c++11 mode against libc++
    MacOS - Sierra v.10.12.6
    Xcode - Version 9.2 (9C40b)
    WebRTC - branch-heads/63
    After playing with compilation options of webrtc, I have compiled with system's clang and using libc++.

    I have builded the webRTC library with parameters:

    gn gen out/x64/Debug --args='is_debug=true target_os="mac" is_component_build=false rtc_include_tests=false target_cpu="x64”’
    export GYP_DEFINES="build_with_libjingle=1 build_with_chromium=0 libjingle_objc=1 clang=1 clang_xcode=1 use_system_libcxx=1 OS=mac"
    export GYP_GENERATORS="ninja, xcode-ninja"
    export GYP_DEFINES="$GYP_DEFINES OS=mac target_arch=x64"
    export GYP_GENERATOR_FLAGS="$GYP_GENERATOR_FLAGS output_dir=out/x64/Debug”
    ninja -v -C out/x64/Debug

    Moreover after extensive googling I have edited common.gypi file in /src/build/

    'xcode_settings': {
    'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
    # (Equivalent to -fPIC)
    'CLANG_CXX_LIBRARY': 'libc++',
    # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
    }

    'GCC_ENABLE_CPP_RTTI': 'YES', # -fno-rtti
    'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO', # -Werror
    'CLANG_CXX_LIBRARY': 'libc++', # -stdlib=libc++

    But unfortunately, the result error is the same!!!

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to the forums.
      Do you mean this ?
      https://github.com/liyouchang/webrtc-qt
      Or is it the (not qt related) code from
      https://webrtc.org/

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Denys Yamkovyi
        wrote on last edited by
        #3

        It's code from https://webrtc.org/

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

          Hi,

          @Denys-Yamkovyi said in Undefined symbols for architecture x86_64 - Linker error when building webrtc Qt for Mac:

          _NSOSStatusErrorDomain

          You need to link to the Foundation framework.

          On a side note, that's a problem of webrtc not Qt, you should check with the authors of that library.

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

          D 1 Reply Last reply
          1
          • SGaistS SGaist

            Hi,

            @Denys-Yamkovyi said in Undefined symbols for architecture x86_64 - Linker error when building webrtc Qt for Mac:

            _NSOSStatusErrorDomain

            You need to link to the Foundation framework.

            On a side note, that's a problem of webrtc not Qt, you should check with the authors of that library.

            D Offline
            D Offline
            Denys Yamkovyi
            wrote on last edited by
            #5

            @SGaist I'm very appreciate for your help! You solved my problem! Thank's a lot!!

            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