1

我正在尝试为 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'?
4

1 回答 1

1

部分复制自评论:

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

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

如果这不起作用,您需要cmake查看日志并在包含路径中查找可能具有string.hcstring在其中的目录,并且可能会被使用而不是默认路径。如果是这种情况,您绝对应该通知维护人员并确定是否只是删除这些文件或包含路径是适当的修复。

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

祝你好运!

于 2012-06-14T17:08:30.613 回答