我按照instruction和ans为xcode设置gtest。但 它仍然无法正常工作,我得到以下错误:
Ld的 /用户/厦新/库/开发商/ Xcode中/ DerivedData /计算器-cchvzojufxzxgfdevhkifabakxpl /编译/产品/调试/测试 正常x86_64 cd / Users / xiaxin / Documents / xCode / Calculator导出 MACOSX_DEPLOYMENT_TARGET = 10.10 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L /用户/厦新/库/开发商/ Xcode中/ DerivedData /计算器-cchvzojufxzxgfdevhkifabakxpl /编译/产品/调试 -L / usr / local / lib -F / Users / xiaxin / Library / Developer / Xcode / DerivedData / Calculator-cchvzojufxzxgfdevhkifabakxpl / Build / Products / Debug -filelist /Users/xiaxin/Library/Developer/Xcode/DerivedData/Calculator-cchvzojufxzxffdevhkifabakxpl/Build/Intermediates/Calculator.build/Debug/Tests.build/Objects-normal/x86_64/Tests.LinkFileList -mmacosx-version-min = 10.10 -lgtest -stdlib = libc ++ -framework gtest -Xlinker -dependency_info -Xlinker /Users/xiaxin/Library/Developer/Xcode/DerivedData/Calculator-cchvzojufxzxffdevhkifabakxpl/Build/Intermediates/Calculator.build/Debug/ Tests.build/Objects-normal/x86_64/Tests_dependency_info.dat -o / Users / xiaxin / Library / Developer / Xcode / DerivedData / Calculator-cchvzojufxzxgfdevhkifabakxpl / Build / Products / Debug / Tests
ld:找不到框架gtest clang:错误:链接器命令失败了 退出代码1(使用-v查看调用)
答案 0 :(得分:0)
您需要将GTest库添加到库路径中。您可以通过设置-L/path/to/gtest