0

我正在尝试在 Xcode 7.3.1 上测试 Jansson。我按照说明安装,然后在不起作用时使用cMake,这也不起作用。我认为 Xcode 无法找到 Jansson 库。在寻找这个问题的广泛建议之后,我以许多不同的方式修改了项目头和库路径。Xcode能够找到标头。另请注意,我能够安装 Jansson 并在 Eclipse 中运行它。任何见解将不胜感激。

这是来自 Xcode 的错误日志:

ld /Users/corrychapman/Library/Developer/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Products/Debug/JanssonDev normal x86_64 cd /Users/corrychapman/Desktop/jansson-2.11/JanssonDev export MACOSX_DEPLOYMENT_TARGET=10.11 /Applications/Xcode。 /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/用户/corrychapman/库/开发人员/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Products/Debug -L/usr/local/lib -L/Users/corrychapman/Desktop/jansson-2。11/JanssonDev -F/Users/corrychapman/Library/Developer/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Products/Debug-filelist/Users/corrychapman/Library/Developer/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Intermediates/ JanssonDev.build/Debug/JanssonDev.build/Objects-normal/x86_64/JanssonDev.LinkFileList -mmacosx-version-min=10.11 -Xlinker -no_deduplicate -Xlinker -dependency_info -Xlinker /Users/corrychapman/Library/Developer/Xcode/DerivedData/ JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Intermediates/JanssonDev.build/Debug/JanssonDev.build/Objects-normal/x86_64/JanssonDev_dependency_info.dat -o /Users/corrychapman/Library/Developer/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Products调试/JanssonDevbuild/Objects-normal/x86_64/JanssonDev.LinkFileList -mmacosx-version-min=10.11 -Xlinker -no_deduplicate -Xlinker -dependency_info -Xlinker /Users/corrychapman/Library/Developer/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Intermediates/ JanssonDev.build/Debug/JanssonDev.build/Objects-normal/x86_64/JanssonDev_dependency_info.dat -o /Users/corrychapman/Library/Developer/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Products/Debug/JanssonDevbuild/Objects-normal/x86_64/JanssonDev.LinkFileList -mmacosx-version-min=10.11 -Xlinker -no_deduplicate -Xlinker -dependency_info -Xlinker /Users/corrychapman/Library/Developer/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Intermediates/ JanssonDev.build/Debug/JanssonDev.build/Objects-normal/x86_64/JanssonDev_dependency_info.dat -o /Users/corrychapman/Library/Developer/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Products/Debug/JanssonDevdat -o /Users/corrychapman/Library/Developer/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Products/Debug/JanssonDevdat -o /Users/corrychapman/Library/Developer/Xcode/DerivedData/JanssonDev-dispcmnteuwiedaiazlbkwtztfcu/Build/Products/Debug/JanssonDev

架构x86_64的未定义符号:“_json_array_get”,引用自:main.o中的_main“_json_array_size”,引用自:main.o中的_main“_json_delete”,引用自:main.o中的_json_decref“_json_loads”,引用自:_main在 main.o “_json_object_get”中,引用自:main.o 中的 _main “_json_string_value”,引用自:main.o 中的 _main ld:未找到体系结构 x86_64 的符号:错误:链接器命令失败,退出代码为 1 (使用 -v 查看调用)

4

1 回答 1

0

找到了。构建设置 -> 链接 -> 其他链接器标志:-ljansson

于 2018-03-26T14:20:32.547 回答