即使明确指定位置,从源代码构建weechat也找不到ncurses.h

时间:2017-03-07 00:50:17

标签: makefile cmake ncurses irc weechat

我正在尝试在服务器上构建weechat IRC客户端(我没有sudo控件)。在配置时,即使在明确提供ncurses文件的位置之后,cmake也无法将它们考虑在内,因此无法找到ncurses.h。

cmake .. -DCMAKE_INSTALL_PREFIX=/home/myuser/.local/ -DNCURSES_INCLUDE_PATH=/home/myuser/.local/include/ncurses/

cmake configure的日志输出是:

-- The C compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for include file langinfo.h
-- Looking for include file langinfo.h - found
-- Looking for include file sys/resource.h
-- Looking for include file sys/resource.h - found
-- Looking for mallinfo
-- Looking for mallinfo - found
-- Looking for eat_newline_glitch
-- Looking for eat_newline_glitch - not found
-- Looking for include file libintl.h
-- Looking for include file libintl.h - found
-- Looking for dgettext
-- Looking for dgettext - found
-- Found GCRYPT: -lgcrypt
-- Found ZLIB: /home/myuser/miniconda2/lib/libz.so (found version "1.2.8")
-- Looking for iconv_open
-- Looking for iconv_open - found
-- Performing Test ICONV_2ARG_IS_CONST
-- Performing Test ICONV_2ARG_IS_CONST - Failed
-- Found CURL: /usr/lib/x86_64-linux-gnu/libcurl.so (found version "7.47.0")
-- Looking for flock
-- Looking for flock - found
-- Looking for backtrace
-- Looking for backtrace - found
-- checking for one of the modules 'ruby-2.4;ruby-2.3;ruby-2.2;ruby-2.1;ruby-2.0;ruby-1.9;ruby-1.8'
-- checking for one of the modules 'lua5.3;lua-5.3;lua53;lua5.2;lua-5.2;lua52;lua5.1;lua-5.1;lua51;lua-5.0;lua5.0;lua50;lua'
-- Found Tclsh: /usr/bin/tclsh (found version "8.6")
-- checking for one of the modules 'guile-2.0'
-- Could NOT find V8 (missing:  V8_LIBRARY V8_INCLUDE_DIR)
-- Looking for include file ncursesw/ncurses.h
-- Looking for include file ncursesw/ncurses.h - not found
-- Looking for include file ncurses.h
-- Looking for include file ncurses.h - not found
-- checking for one of the modules 'cpputest'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/myuser/tools/weechat/build

我已经开了relevant issue in weechat,但还没有帮助。那些从头开始成功建造它的人,你能帮助我吗?

编辑1 :在设法让我的系统管理员安装“libncurses5-dev”和“libncursesw5-dev”后,安装工作正常。虽然当我开始weechat时,会弹出这个错误:

weechat: Symbol `acs_map' has different size in shared object, consider re-linking Segmentation fault (core dumped)

编辑2

我正在尝试在删除全局ncurses后从我的本地ncurses安装中再次构建它。 ncurses 的安装文件在

目录中存在
~/.local/include $ ls -lhtr | grep ncurses
drwxr-xr-x 2 myuser nogroup   22 Sep 25 22:05 ncurses
drwxr-xr-x 2 myuser nogroup   22 Sep 25 23:52 ncursesw

~/.local/include/ncurses $ ls -lhtr
total 320K
-rw-r--r-- 1 myuser nogroup  38K Sep 25 22:05 term.h
-rw-r--r-- 1 myuser nogroup  64K Sep 25 22:05 curses.h
lrwxrwxrwx 1 myuser nogroup    8 Sep 25 22:05 ncurses.h -> curses.h
-rw-r--r-- 1 myuser nogroup 3.0K Sep 25 22:05 unctrl.h
-rw-r--r-- 1 myuser nogroup 3.5K Sep 25 22:05 termcap.h
-rw-r--r-- 1 myuser nogroup 3.9K Sep 25 22:05 ncurses_dll.h
-rw-r--r-- 1 myuser nogroup  12K Sep 25 22:05 tic.h
-rw-r--r-- 1 myuser nogroup 6.9K Sep 25 22:05 term_entry.h
-rw-r--r-- 1 myuser nogroup 3.9K Sep 25 22:05 nc_tparm.h
-rw-r--r-- 1 myuser nogroup 3.7K Sep 25 22:05 panel.h
-rw-r--r-- 1 myuser nogroup 2.9K Sep 25 22:05 eti.h
-rw-r--r-- 1 myuser nogroup  12K Sep 25 22:05 menu.h
-rw-r--r-- 1 myuser nogroup  17K Sep 25 22:05 form.h
-rw-r--r-- 1 myuser nogroup 6.5K Sep 25 22:05 cursesapp.h
-rw-r--r-- 1 myuser nogroup  27K Sep 25 22:05 cursesf.h
-rw-r--r-- 1 myuser nogroup  20K Sep 25 22:05 cursesm.h
-rw-r--r-- 1 myuser nogroup 8.3K Sep 25 22:05 cursesp.h
-rw-r--r-- 1 myuser nogroup  49K Sep 25 22:05 cursesw.h
-rw-r--r-- 1 myuser nogroup 7.2K Sep 25 22:05 cursslk.h
-rw-r--r-- 1 myuser nogroup 9.1K Sep 25 22:05 etip.h

我按照以下答案的建议与cmake-DNCURSES_INCLUDE_PATH=/home/myuser/.local/include/ncurses/一起运行了-DNCURSES_INCLUDE_PATH=/home/myuser/.local/include/,但它没有用。

1 个答案:

答案 0 :(得分:1)

您使用的命令

-DNCURSES_INCLUDE_PATH=/home/myuser/.local/include/ncurses/

我希望包含日志中显示的任何选项:

-- Looking for include file ncursesw/ncurses.h
-- Looking for include file ncursesw/ncurses.h - not found
-- Looking for include file ncurses.h
-- Looking for include file ncurses.h - not found

尝试

    -DNCURSES_INCLUDE_PATH=/home/myuser/.local/include/

如果您有其中一个实际文件:

    /home/myuser/.local/include/ncurses/ncurses.h
    /home/myuser/.local/include/ncursesw/ncurses.h

cmake macro考虑​​了ncurses --disable-overwrite configure option的最常见变体,它会将头文件放在include目录的子目录中。除非您在配置和安装ncurses时遇到异常,否则其头文件将位于子目录ncursesncursesw中。虽然一些开发人员在搜索路径中指定了子目录,但这种方法从未被推荐(也不可靠)接近它,如ncurses INSTALL file中所述。