一.错误提示
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)make[2]: *** [tts] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1
二.解决办法
生成b2:
./bootstrap.sh
用b2编译:
./b2 toolset=clang cxxflags="-arch x86_64" linkflags="-arch x86_64"
如此可以得到合适的库.a 和 .dylib
然后所有需要用到.a库的地方,挨个加上就是了.比如
tts_LDADD = -liconv \
+ libboost_regex.a
三.原因分析(待验证)
boost库编译的时候,弄成了i386的
正确的dylib
[user boost] file libboost_regex.dylib
libboost_regex.dylib: Mach-O 64-bit dynamically linked shared library x86_64
错误的dylib
[user boost] file libboost_regex.dylib
libboost_regex.dylib: Mach-O 64-bit dynamically linked shared library i386