【发布时间】:2014-02-12 10:23:09
【问题描述】:
我正在 xcode5 中构建我的 makefile 项目,它在大多数情况下都运行良好。这是一个带有许多子目录的 autoconf 项目 - 没什么大不了的。
但是,问题导航器确实存在问题。当我在项目中的某个文件中出现错误时,xcode 会正确检测到问题并在问题导航器中吐出错误 - 但是似乎 xcode 无法将错误链接到项目导航器中的文件。
在下面的示例中,我在“hello”方法之一中插入了一个垃圾字符串,这显然编译器不满意。不幸的是,即使在项目中也找不到 .cpp 文件
我怀疑 xcode 通过解析 makefile/clang++ 的输出并尝试确定问题所在 - 但显然失败了。
这是来自日志导航器的日志
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in src
make[2]: Nothing to be done for `all'.
Making all in src/pops
make[2]: Nothing to be done for `all'.
Making all in src/jops
make[2]: Nothing to be done for `all'.
Making all in src/jops/tops
/bin/sh ../../../libtool --tag=CXX --mode=compile clang++ -std=c++11 -DHAVE_CONFIG_H -I. -I../../.. -I /usr/include/openssl -I../../../src/ -g -O2 -MT test.lo -MD -MP -MF .deps/test.Tpo -c -o test.lo test.cpp
libtool: compile: clang++ -std=c++11 -DHAVE_CONFIG_H -I. -I../../.. -I /usr/include/openssl -I../../../src/ -g -O2 -MT test.lo -MD -MP -MF .deps/test.Tpo -c test.cpp -fno-common -DPIC -o .libs/test.o
test.cpp:8:9: error: use of undeclared identifier 'hello'
hello
^
1 error generated.
make[2]: *** [test.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
谁能帮我帮助 xcode 在问题导航器中找到文件?它将帮助我使用我非常喜欢的 xcode IDE 调试这个项目。
【问题讨论】:
-
我找到了一个 hacky 解决方案。在 Makefile.am 中,我在每个 .cpp 文件之前指定 ${PWD}/。
标签: xcode5 autoconf automake libtool