简体   繁体   中英

XCode C++: Linker command failed with exit code 1 library not found for -lboost_regex

{There are many possible duplicates for Linker command related problems I read all of them I could find but none helped me so I am posting a new question.}

My build is failing with following Linker message: ld: library not found for -lboost_regex clang: error: linker command failed with exit code 1 (use -v to see invocation) .

Though I have supplied boost-regex static library.

EDIT: I have added libboost_regex.a in Build Phases->Link Binary With Library

Ld command executed by XCode is as following.

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

What could be the reason? Any help will be appreciated.

I have solved this problem. I used dynamic library for boost-regex instead of static library. It solved my problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM