2017-03-07 35 views
0

我試圖在服務器上構建weechat IRC客戶端(我沒有sudo控件)。在配置時,即使明確提供了ncurses文件的位置,cmake也沒有考慮到它們,因此無法找到ncurses.h。從源代碼構建weechat即使在明確指定位置時也找不到ncurses.h

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

的CMake的配置日誌輸出是這樣的:

-- 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/通過下面的答案的建議,但沒有奏效。

+0

庫轉儲核心是一個不同的問題(你將不得不說服cmake找到正確的庫/包含組合)。 –

+0

是的,我知道。但即使提供一切cmake它甚至不考慮位置。我不熟悉cmake腳本,但我認爲[FindNCurses.cmake](https://github.com/weechat/weechat/blob/master/cmake/FindNcurses.cmake)文件存在一些問題。爲什麼不考慮每個組合。 –

回答

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中所述。

+0

也試過這個。仍然無法找到它。 –

+0

你的答案沒有顯示ncurses頭文件的實際位置,所以沒有人能提供超過一般的建議。 –

+0

我的ncurses.h頭文件與您在答案中指出的位置完全相同:/home/myuser/.local/include/ncurses/ncurses.h。後來我設法讓我的系統管理員全局安裝libncurses,這使安裝工作。之後,運行weechat會給我這個錯誤:'weechat:符號'acs_map'在共享對象中具有不同的大小,請考慮重新鏈接,Segmentation Fault' –

相關問題