重複錯誤:#error「僅可以直接納入。

重複錯誤:#error「僅可以直接納入。

我有一個關於作者歸因壓縮距離的研究。我應該在工作中使用“Complearn”,這是一個壓縮程式。但一開始我在安裝這個程式時遇到了問題。

1)我從這個連結下載程式到Linux Mint(它位於我的Windows電腦的虛擬機器(VirtualBox中的VM));

http://www.complearn.org/downloads/libcomplearn-1.1.7.ta​​r.gz

2)我在程式的終端機視窗中一一寫入(當然在程式目錄中),

./configure

(在設定步驟之後,我收到了一些關於需求依賴項的錯誤,例如gsl、zlib 等。我安裝了所有這些錯誤。最後需要glib。我安裝了它,但它又給了我一個關於舊版本glib 存在的錯誤.錯誤是這樣的:

    checking for GLIB - version >= 2.0.0... 
*** 'pkg-config --modversion glib-2.0' returned 2.42.0, but GLIB (2.40.2)
*** was found! If pkg-config was correct, then it is best
*** to remove the old version of GLib. You may also be able to fix the error
*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing
*** /etc/ld.so.conf. Make sure you have run ldconfig if that is
*** required on your system.
*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH
*** to point to the correct configuration files
no
configure: error: must have glib >= 2.0.0 and gobject installed

我用這個命令解決了它:

echo $LD_LIBRARY_PATH 導出 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

之後我嘗試 ./configure 步驟,它沒有失敗。

然後

 make

它因以下錯誤而失敗:

> In file included from anydecompress.c:32:0:
> /usr/local/include/glib-2.0/glib/garray.h:29:2: error: #error "Only <glib.h> can be included directly."
>   #error "Only <glib.h> can be included directly."
>   ^
> In file included from /usr/local/include/glib-2.0/glib/garray.h:32:0,
>                  from anydecompress.c:32:
> /usr/local/include/glib-2.0/glib/gtypes.h:29:2: error: #error "Only <glib.h> can be included directly."
>  #error "Only <glib.h> can be included directly."
>  ^
> In file included from /usr/local/lib/glib-2.0/include/glibconfig.h:9:0,
>                  from /usr/local/include/glib-2.0/glib/gtypes.h:32,
>                  from /usr/local/include/glib-2.0/glib/garray.h:32,
>                  from anydecompress.c:32:
> /usr/local/include/glib-2.0/glib/gmacros.h:33:2: error: #error "Only <glib.h> can be included directly."
>   #error "Only <glib.h> can be included directly."
>  ^ 
> In file included from /usr/local/include/glib-2.0/glib/gtypes.h:34:0,
>                  from /usr/local/include/glib-2.0/glib/garray.h:32,
>                  from anydecompress.c:32:
> /usr/local/include/glib-2.0/glib/gversionmacros.h:29:2: error: #error "Only <glib.h> can be included directly."
>  #error "Only <glib.h> can be included directly." 
>  ^ 
> anydecompress.c: In function ‘main’:
> anydecompress.c:59:3: warning: ‘g_type_init’ is deprecated (declared at /usr/local/include/glib-2.0/gobject/gtype.h:679) [-Wdeprecated-declarations]    
>  g_type_init ();   
> ^
> make[2]: *** [anydecompress-anydecompress.o] Error 1
> make[2]: Leaving directory `/home/kubra/libcomplearn-1.1.7/src' 
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/home/kubra/libcomplearn-1.1.7/src' 
> make: *** [all-recursive] Error 1

這是什麼意思?我該怎麼做才能解決這個問題?請你幫助我好嗎?我在谷歌搜尋中沒有找到任何解決此錯誤的建議。

謝謝。

相關內容