Closed BeiKeJieDeLiuLangMao closed 6 years ago
Hi @BeiKeJieDeLiuLangMao,
I'm experiencing a similar issue:
Undefined symbols for architecture x86_64:
"_CFBundleGetIdentifier", referenced from:
rtc::LogMessage::OutputToDebug(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rtc::LoggingSeverity) in libwebrtc.a(logging.o)
"_CFBundleGetMainBundle", referenced from:
rtc::LogMessage::OutputToDebug(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rtc::LoggingSeverity) in libwebrtc.a(logging.o)
"_CFPreferencesGetAppBooleanValue", referenced from:
rtc::LogMessage::OutputToDebug(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rtc::LoggingSeverity) in libwebrtc.a(logging.o)
"_CFRelease", referenced from:
rtc::LogMessage::OutputToDebug(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rtc::LoggingSeverity) in libwebrtc.a(logging.o)
"_CFStringCreateWithCString", referenced from:
rtc::LogMessage::OutputToDebug(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rtc::LoggingSeverity) in libwebrtc.a(logging.o)
"_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)
"_kCFAllocatorDefault", referenced from:
rtc::LogMessage::OutputToDebug(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, rtc::LoggingSeverity) in libwebrtc.a(logging.o)
"_objc_autoreleasePoolPop", referenced from:
rtc::ThreadManager::ThreadManager() in libwebrtc.a(thread_darwin.o)
rtc::ThreadManager::ThreadManager() 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)
"_objc_autoreleasePoolPush", referenced from:
rtc::ThreadManager::ThreadManager() in libwebrtc.a(thread_darwin.o)
rtc::ThreadManager::ThreadManager() 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)
"_objc_msgSend", referenced from:
rtc::ThreadManager::ThreadManager() in libwebrtc.a(thread_darwin.o)
rtc::ThreadManager::ThreadManager() in libwebrtc.a(thread_darwin.o)
rtc::DescriptionFromOSStatus(int) in libwebrtc.a(logging_mac.o)
"_objc_release", referenced from:
rtc::DescriptionFromOSStatus(int) in libwebrtc.a(logging_mac.o)
"_objc_retainAutorelease", referenced from:
rtc::DescriptionFromOSStatus(int) in libwebrtc.a(logging_mac.o)
"_objc_retainAutoreleasedReturnValue", referenced from:
rtc::DescriptionFromOSStatus(int) in libwebrtc.a(logging_mac.o)
May you please comment on your solution?
Reduced the previous undefined symbol list to:
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_$_NSThread", referenced from:
objc-class-ref in libwebrtc.a(thread_darwin.o)
ld: symbol(s) not found for architecture x86_64
By adding the following lines to the CMakeLists.txt:
find_library(CORE_FOUNDATION CoreFoundation)
find_library(APPLICATION_SERVICES ApplicationServices)
find_library(CORE_SERVICES CoreServices)
set(EXTRA_LIBS ${CORE_FOUNDATION} ${APPLICATION_SERVICES} ${CORE_SERVICES})
Still looking at it
Finally linked by:
find_library(CORE_FOUNDATION Foundation)
find_library(APPLICATION_SERVICES ApplicationServices)
find_library(CORE_SERVICES CoreServices)
set(EXTRA_LIBS ${CORE_FOUNDATION} ${APPLICATION_SERVICES} ${CORE_SERVICES})
@jmillan could you elaborate on where you had to add the CMakeLists.txt file?
Was it the webrc/src
folder?
Or inside the project where you were trying to use webrtc?
@hkirat,
In the project where I was using webrtc.
I am a new bee for c++, i build libwebrtc in my mac, change PKG_CONFIG_PATH to be /path/to/libwebrtc/out, and change LibWebRTC.pc like follow
But when i execute this command to run your sample, a error happened.
$ g++
pkg-config --cflags LibWebRTCmain.cpp -o main
pkg-config --libs LibWebRTC``Did i make a mistake with LibWebRTC.pc or maybe others?