clang: error: link命令失败,退出代码为1(使用-v查看调用)
ld: library not found for -lboost_system clang: error: linker command failed with exit code 1 (use -v to see invocation)
在尝试了几种解决方案后,我认为我需要一些帮助来理解如何为Mac OSX Lion正确构建Boost,在XCode 4上构建跨平台应用程序没有成功=s
我遵循了这个指南。并依次执行以下命令:
cd /Users/me/Documents/boost_1_53_0
./bootstrap.sh --prefix=installation
cd /Users/me/Documents/boost_1_53_0/tools/build/v2
./bootstrap.sh
./b2 install --prefix=installation
export PATH=$PATH:installation/bin
cd /Users/me/Documents/boost_1_53_0
./b2 --build-dir=installation toolset=darwin cxxflags="-arch i386" address-model=32 architecture=x86 stage
在尝试在XCode上编译应用程序后,我得到了问题标题中的错误,并进行了以下编辑:
将这些库添加到"Build Phases"下的"Link Binary With Libraries"中:
libboost_filesystem.dylib
libboost_system.dylib
并添加了"$(srroot)/.."/boost_1_53_0"到标头和库搜索路径。
看看Stackoverflow上的其他一些问题,很多人似乎用makefiles来构建boost,并在makefile中传递LDFLAGS=-L/opt/local/lib;
我在哪里可以找到一个很好的教程或例子,建设促进?我没有自己制作makefile的经验,尽管我在这里和那里进行了一些简单的编辑。
检查您的boost dylib在哪里。可能是在"$(SRCROOT)/../boost_1_53_0"中的某个中间目录下?例如:$(SRCROOT)/../boost_1_53_0/lib。如果是这样,将整个路径添加到构建设置中的"库搜索路径"中。
顺便说一下:您确定要动态链接而不是静态链接吗?
相关文章:
- 没有头文件如何使用c ++调用其他模块中的函数?
- 使用 %s 调用 printf 并传递零长度的字符*是未定义的行为吗?
- 使用 "()" 调用构造函数不同于"{}"
- 使用 c++ 调用.dll的默认参数的函数
- 当我同时将 T& 和 T 作为同名函数的返回类型时,如何使用 T& 调用函数
- 使用 P/调用传递取消标志时是否需要同步
- 当被调用方法使用调用方已锁定的同一锁时,如何避免死锁
- 在QT Creator中使用C++调用Python脚本
- C++按引用传递:如何使用调用堆栈
- 如何使用调用和别名指令在 llvm 字节码中查找函数名称
- 如何使用调用和分配指令在 llvm 字节码中查找类名
- 使用C++调用带有库的powershell脚本
- c++-如何使用调用函数的对象
- 使用 C++ 调用函数,其名称两边带有括号
- 如何 使用 C++ 调用 LabVIEW 构建 的 DLL
- 使用c#调用返回struct数组的非托管dll函数
- CUDA c++:使用调用模板内核的模板函数
- 如何创建win32智能手机dll并在WinCE中使用c#调用dll
- 使用 "->" 调用函数
- 错误:使用 C++ 调用 没有匹配函数