CMake 找不到 Curses
我正在尝试从 www 编译 openlase 库.marcansoft.com 并遇到了 CMake 问题。 CMake 返回一个错误,指出它找不到 Curses,经过大量查看后,我仍然对问题所在感到困惑。我已检查是否安装了各种 ncurses 软件包,但错误仍然存在。我对 CMake 不太熟悉,但我能够解决在此之前出现的其他依赖问题。以下是终端的输出。
tom@SILVER:~/dev/openlase$ cmake ./
-- Found JACK
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:70 (MESSAGE):
Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindCurses.cmake:159 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
examples/27c3_slides/CMakeLists.txt:3 (find_package)
-- Configuring incomplete, errors occurred!
任何帮助将不胜感激。
- 汤姆
I am trying to compile the openlase library from www.marcansoft.com and have been running into problems with CMake. CMake is returning an error stating that it cannot find Curses, and after a lot of looking I am still stumped as to what the issue is. I have checked that I have the various ncurses packages installed but still the error persists. Im not very familiar with CMake but I was able to resolve other dependency issues that arose before this one. The following is the output in terminal.
tom@SILVER:~/dev/openlase$ cmake ./
-- Found JACK
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:70 (MESSAGE):
Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindCurses.cmake:159 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
examples/27c3_slides/CMakeLists.txt:3 (find_package)
-- Configuring incomplete, errors occurred!
Any help would be greatly appreciated.
- Tom
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这是解决我在 Ubuntu 12.04 x86_64 (64 位)上的问题的方法(感谢 syslogic )
无论出于何种原因(可能是凌晨 1:00?)设置 CURSES_USE_NCURSES TRUE 似乎不起作用。所以我就去做了一份黑客工作。
验证其已安装:
您将看到以下内容:
libncurses5-dev 已经是最新版本。
因此找到该库并包含。
$locate libncurses.so
注意位置,我的:
/usr/lib/x86_64-linux-gnu/libncurses.so
$locatecurses.h
再次注意位置,我的:
/usr/include
在:/Modules/FindCurses.cmake
添加在顶部,就在注释之后,
然后冲洗重复构建过程
ccmake 现在应该被安装。
你的朋友,
Here is what fixed my problems on Ubuntu 12.04 x86_64 (64 bit) (Thanks syslogic )
For whatever reason (1:00 am maybe?) setting CURSES_USE_NCURSES TRUE didn't seem to work. So I went with a hack job.
Verified it's installed:
You will see something to the effect:
libncurses5-dev is already the newest version.
So find the library and include.
$ locate libncurses.so
Note location, mine:
/usr/lib/x86_64-linux-gnu/libncurses.so
$ locate curses.h
Note location again, mine:
/usr/include
In:
<cmake source dir>/Modules/FindCurses.cmake
add at the top, right after the comments
then rinse repeat the build process
ccmake should now be installed.
Your pal,
修复此问题的另一种方法是将以下两行添加到 FindCurses.cmake(顶部):
Another way to fix it is to add these 2 lines to FindCurses.cmake (on top):
暂时将 CURSES_USE_NCURSES 设置为 TRUE 以强制使用 NCURSES,而不是让 CMake 尝试查找 CURSES。
Temporarily set CURSES_USE_NCURSES to TRUE to force the use of NCURSES, rather than letting CMake try to find CURSES.
您是否也安装了相应的
-dev
软件包?在 Ubuntu(可能还有任何源自 Debian 的系统)上,它是libncurses5-dev
。其他系统可能使用-devel
或类似标签。编译器正在查找库标头,而标准包未提供这些标头。 (这些标头在运行时不需要,只有在编译软件时才需要,因此它们可以轻松地为不进行任何软件编译的系统删除多余的无用内容。)
Do you have the corresponding
-dev
package installed too? On Ubuntu (and probably anything derived from Debian) it islibncurses5-dev
. Other systems may use-devel
or similar tags.The compiler is looking for the library headers, and those aren't provided by the standard package. (The headers aren't needed at runtime, only when compiling software, so they make it easy to remove extra useless stuff for systems that aren't going to be doing any software compiling.)
openlase wiki 没有显示所有需要的包。检查 github 上的 wiki 页面以获取更新的说明。对于curses,缺少的软件包是libncurses5-dev
sudo apt-get install libncurses5-dev
The openlase wiki was not displaying all of the needed packages. Check there wiki pages on github for updated instructions. For curses the missing package was libncurses5-dev
sudo apt-get install libncurses5-dev
暂时将 CURSES_NEED_NCURSES 设置为 TRUE 以强制使用 NCURSES,而不是让 CMake 尝试查找 CURSES。
Curses_USE_NCURSES 由 FindCurses.cmake 在内部使用,因此设置不会有帮助。
Temporarily set CURSES_NEED_NCURSES to TRUE to force the use of NCURSES, rather than letting CMake try to find CURSES.
CURSES_USE_NCURSES is used by FindCurses.cmake internally, so setting that won't help.