XCode C++:链接器命令失败,退出代码 1 库未找到 -lboost_regex
XCode C++: Linker command failed with exit code 1 library not found for -lboost_regex
{与链接器命令相关的问题可能有很多重复项,我阅读了所有我能找到的问题,但 none 帮助了我,所以我发布了一个新问题。}
我的构建失败并显示以下链接器消息:
ld: library not found for -lboost_regex
clang: error: linker command failed with exit code 1 (use -v to see invocation)
.
虽然我提供了 boost-regex 静态库。
编辑: 我在 Build Phases->Link Binary With Library
中添加了 libboost_regex.a
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
可能是什么原因?任何帮助将不胜感激。
我已经解决了这个问题。我使用 boost-regex 的动态库而不是静态库。它解决了我的问题。
{与链接器命令相关的问题可能有很多重复项,我阅读了所有我能找到的问题,但 none 帮助了我,所以我发布了一个新问题。}
我的构建失败并显示以下链接器消息:
ld: library not found for -lboost_regex
clang: error: linker command failed with exit code 1 (use -v to see invocation)
.
虽然我提供了 boost-regex 静态库。
编辑: 我在 Build Phases->Link Binary With Library
libboost_regex.a
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
可能是什么原因?任何帮助将不胜感激。
我已经解决了这个问题。我使用 boost-regex 的动态库而不是静态库。它解决了我的问题。