XCode C ++:链接器命令失败,找不到-lboost_regex

时间:2017-03-01 11:21:20

标签: c++ xcode boost linker boost-regex

{链接器命令相关问题有很多可能的重复我读了所有这些我能找到但没有人帮助我所以我发布了一个新问题。}

我的构建失败并显示以下链接器消息: ld: library not found for -lboost_regex clang: error: linker command failed with exit code 1 (use -v to see invocation)

虽然我提供了boost-regex静态库。

编辑:我在libboost_regex.a

中添加了Build Phases->Link Binary With Library Ld执行的

XCode命令如下。

Ld /Applications/Adobe\ InDesign\ CC\ 2017/Plug-Ins/AdWrks-CC17.v1.1.InDesignPlugin/Versions/A/AdWrks-CC17.v1.1 normal x86_64 cd /Users/apple/SDKs/CS12SDK/build/mac/prj export MACOSX_DEPLOYMENT_TARGET=10.11 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Applications/Adobe\ InDesign\ CC\ 2017/Plug-Ins -L../../../build/mac/release_cocoa64/packagefolder/contents/macos/libs -L/Users/apple/SDKs/CS12SDK/build/mac/prj/../../../.. -L/Users/apple/SDKs/CS12SDK/build/mac/prj/../../../source/sdksamples/AdWorks -F/Applications/Adobe\ InDesign\ CC\ 2017/Plug-Ins -F../../../build/mac/release_cocoa64/packagefolder/contents/macos -F../../../build/mac/release_cocoa64/packagefolder/contents/Frameworks -filelist /Users/apple/SDKs/CS12SDK/build/mac/prj/build/AdWrks-CC17.build/Default/Release_Cocoa64.build/Objects-normal/x86_64/AdWrks-CC17.v1.1.LinkFileList -install_name ./AdWrks-CC17.v1.1.InDesignPlugin/Versions/A/AdWrks-CC17.v1.1 -mmacosx-version-min=10.11 -dead_strip -no_dead_strip_inits_and_terms -Wl,-executable_path -Wl,../../../build/mac/Release_Cocoa64/packagefolder/contents/macos/ -stdlib=libc++ -lboost_regex-mt -lboost_regex-mt -lboost_regex -lcrypto.0.9.8 -lxerces-c-3.1 -lxerces-c.28 -lz.1.2.5 -framework InDesignModelAndUI -lxerces-c.28 -lboost_regex-mt -lPublicPlugIn -single_module -Xlinker -dependency_info -Xlinker /Users/apple/SDKs/CS12SDK/build/mac/prj/build/AdWrks-CC17.build/Default/Release_Cocoa64.build/Objects-normal/x86_64/AdWrks-CC17.v1.1_dependency_info.dat -o /Applications/Adobe\ InDesign\ CC\ 2017/Plug-Ins/AdWrks-CC17.v1.1.InDesignPlugin/Versions/A/AdWrks-CC17.v1.1

可能是什么原因?任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

我已经解决了这个问题。我使用动态库来表示boost-regex而不是静态库。它解决了我的问题。