【发布时间】:2016-04-12 09:53:40
【问题描述】:
我正在努力将 cmake 安装到 OSX 10.8(山狮)
$ brew install -v cmake
但是,我收到以下错误。
[ 2%] Built target cmcompress
In file included from /tmp/cmake20160412-70643-1kq4xsy/cmake-3.4.0/Source/CursesDialog/form/fld_arg.c:33:
In file included from /tmp/cmake20160412-70643-1kq4xsy/cmake-3.4.0/Source/CursesDialog/form/form.priv.h:34:
/tmp/cmake20160412-70643-1kq4xsy/cmake-3.4.0/Source/CursesDialog/form/form.h:46:12: fatal error: 'ncurses/ncurses.h' file not found
# include <ncurses/ncurses.h>
^
1 error generated.
收到上述错误后,我通过brew install ncurses 安装了ncurses。但是,错误消息'ncurses/ncurses.h' file not found 仍然出现。
请帮助解决这个问题...
更新
根据locate命令,我的文件系统中有多个ncurses.h文件:
$ locate ncurses.h
/Applications/XAMPP/xamppfiles/include/ncurses/ncurses.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/ncurses.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/ncurses.h
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/include/ncurses.h
/opt/local/include/ncurses/ncurses.h
/opt/local/include/ncursesw/ncurses.h
/sw/include/ncurses.h
/usr/include/ncurses.h
更新 2
这解决了问题:
$ ln -s /opt/local/include/ncurses /usr/include
因为c编译器会搜索以下路径
$ clang++ -x c -v -E /dev/null
...
/usr/local/include
/usr/bin/../lib/clang/5.1/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
...
【问题讨论】:
-
WRT 更新 #2:天哪。你真的搞砸了你的系统。你知道你可以使用
-I来添加一个包含目录,对吧? -
@trojanfoe 是的...我同意添加符号链接会弄乱我的系统...即使通过
brew install安装也可以添加 -I 选项吗? -
我不知道 TBH 我一直认为自制软件很垃圾,所以我使用 macports。看起来该端口(或他们称之为的任何端口)已损坏,因为它取决于 ncurses,但它并没有自动安装它。我会从自制论坛获得帮助。