我正在尝试为 OS X 编译Clementine。在编译依赖项的过程中途,在 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'?