gpt4 book ai didi

c++ - OS X Lion 上的 libplist 编译错误 : string. h not found

转载 作者:太空宇宙 更新时间:2023-11-04 04:01:36 24 4
gpt4 key购买 nike

我正在尝试编译 Clementine对于 OS X。在编译依赖项的过程中,在 libplist-1.3 期间,我收到编译器无法找到 string.h、assert.h 等的错误。然后出现大量错误。

我不确定为什么会这样。我在处理较大的 C 项目方面不是很有经验,如果能找到任何方向来找出为什么会这样,我将不胜感激。我肯定已经安装了 Xcode 命令行工具并确保它们是最新的。此外,标准文件位于 /usr/include 中。

根据构建指令运行 make 后的输出:

cd libplist-1.3/build && PKG_CONFIG_PATH=/Users/dan/projects/sandbox/target/lib/pkgconfig cmake .. -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_INSTALL_PREFIX=/Users/dan/projects/sandbox/target -DQT_HEADERS_DIR=/Users/dan/projects/sandbox/target/include/ -DQT_LIBRARY_DIR=/Users/dan/projects/sandbox/target/bin -DENABLE_PYTHON=OFF
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

QT_HEADERS_DIR
QT_LIBRARY_DIR


-- Build files have been written to: /Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/build
cd libplist-1.3/build && PATH=/Users/dan/projects/sandbox/target/bin:$PATH make -j2
[ 12%] [ 12%] Building C object src/CMakeFiles/plist.dir/plist.c.o
Building C object src/CMakeFiles/plist.dir/bplist.c.o
/Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/src/plist.c:23:20: error: string.h: No such file or directory
/Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/src/plist.c:24:20: error: assert.h: No such file or directory
In file included from /Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/src/plist.h:25,
from /Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/src/plist.c:25:
/Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/include/plist/plist.h:48:20: error: stdint.h: No such file or directory
/Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/include/plist/plist.h:52:23: error: sys/types.h: No such file or directory
In file included from /Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/src/plist.h:25,
from /Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/src/plist.c:25:
/Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/include/plist/plist.h:128: error: expected ‘)’ before ‘val’
/Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/include/plist/plist.h:137: error: expected ‘)’ before ‘val’
/Users/dan/projects/sandbox/clementine-dep/macosx/libplist-1.3/include/plist/plist.h:156: error: expected declaration specifiers or ‘...’ before ‘uint64_t’

..还有更多

更新:

当删除 -j2 标志时,libplist 构建成功。现在我收到一个新错误:

Scanning dependencies of target libproxy
[ 54%] Building CXX object libproxy/CMakeFiles/libproxy.dir/extension_config.cpp.o
[ 57%] Building CXX object libproxy/CMakeFiles/libproxy.dir/extension_pacrunner.cpp.o
[ 60%] Building CXX object libproxy/CMakeFiles/libproxy.dir/extension_wpad.cpp.o
[ 63%] Building CXX object libproxy/CMakeFiles/libproxy.dir/proxy.cpp.o
/Users/dan/projects/sandbox/clementine-deps/macosx/libproxy-0.4.7/libproxy/proxy.cpp:433:15: error: use of undeclared identifier
'strdup'; did you mean 'strcmp'?

最佳答案

部分复制自评论:

尝试使用 make 而不是 make -j 2 进行编译。有时编译顺序可能会搞砸,这在您链接到的包站点中明确提到。

至于 strdup 的问题,该函数在 C 的 string.h 和 C++ 的 cstring 中声明。如果包构建正确并且没有创建重复的 header 或尝试使用来自非标准位置的 header ,那么从全新构建开始可能会解决您的问题。

如果这不起作用,您需要查看 cmake 日志并在包含路径中查找可能包含 string.h 的目录cstring 并且可能会被使用而不是默认的。如果是这种情况,您绝对应该通知维护者并弄清楚简单地删除这些文件或包含路径是否是适当的修复。

除此之外,我认为您必须通过他们的网站与软件包维护者取得联系。

祝你好运!

关于c++ - OS X Lion 上的 libplist 编译错误 : string. h not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11025035/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com