我在安装版本的libsasl2(Cyrus SASL)时遇到了一些麻烦.
特别是,似乎本地头文件和sasl_version报告版本2.1.26,但没有为全局函数sasl_client_done提供符号.
我很确定我应该有这个符号,因为:
复制:
未注释的代码在yosemite上产生链接错误
Undefined symbols for architecture x86_64:
"_sasl_client_done", referenced from:
_main in foo-072675.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
使用以下命令调用编译器:
clang -Wall -Werror -lsasl2 -o foo foo.c -v
Run Code Online (Sandbox Code Playgroud)
与clang -v:
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.10.0 -emit-obj -mrelax-all …Run Code Online (Sandbox Code Playgroud)