我正在使用 C+ 库 Ex:sample.lib。现在我想将此库路径添加到 xcode 中的 Other linker flag。
我是这样加的
-L/(library path) -llibsample
或
-L/(library path) -lsample
或
-L/(library path) -lsample.lib
ld: library not found for -llibsample or -lsample or -lsample.lib collect2: ld returned 1 exit status Command /Xcode Tools/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
如何将我的 lib 文件添加到其他链接器标志中?
最佳答案
请检查 LD_LIBRARY_PATH,因为如果 LD_LIBRARY_PATH 设置不正确,也会出现此问题
关于c++ - 如何将c++库路径添加到xcode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11647555/