[英]Mac OS X Sierra : Undefined symbols for architecture x86_64
我正在嘗試在Mac OS X Sierra中基於Linphone構建一個C源文件但是出現以下錯誤。
這是C源文件的鏈接。 http://www.linphone.org/docs/liblinphone/group__basic__call__tutorials.html
編輯:
我試圖用這個命令編譯源代碼
clang -o tt tt.c -I / Users / softdev / Downloads / linphone-sdk-3.11.1-mac / include /
錯誤:
架構x86_64的未定義符號
ld:找不到架構x86_64的符號
clang:錯誤:鏈接器命令失敗,退出代碼為1(使用-v查看調用)
我試圖改變目標cpu但沒有工作。
我的系統有XCode 8.任何有關這方面的幫助將不勝感激。
編輯:完成輸出
Undefined symbols for architecture x86_64: "_linphone_call_get_state", referenced from: _main in tt-ca2045.o "_linphone_call_ref", referenced from: _main in tt-ca2045.o "_linphone_call_unref", referenced from: _main in tt-ca2045.o "_linphone_core_destroy", referenced from: _main in tt-ca2045.o "_linphone_core_invite", referenced from: _main in tt-ca2045.o "_linphone_core_iterate", referenced from: _main in tt-ca2045.o "_linphone_core_new", referenced from: _main in tt-ca2045.o "_linphone_core_terminate_call", referenced from: _main in tt-ca2045.o "_ms_usleep", referenced from: _main in tt-ca2045.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
我得到了使用這個編譯的示例代碼:
clang -o hello hello.c -Ilinphone-sdk-3/include -Llinphone-sdk-3/lib -llinphone -lmediastreamer_base
Clang的-I
參數指向標題(.h)文件所在的位置
至於我的補充, -L
指定了clang到達lib文件所在位置的路徑 。 在你的情況下,它可能存在於-L/Users/softdev/Downloads/linphone-sdk-3.11.1-mac/lib
然后-l
指定要包含哪些dylib(去掉lib
前綴和dylib
后綴)。
最后,您需要在指向的示例代碼中添加缺失行。 加:
#include <unistd.h>
在signal.h
之后
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.