[英]gcc on my linux system is installed, still giving failure in installation
當我嘗試在Linux服務器上安裝libxml2時,出現以下錯誤。 我機器上的Gcc已安裝並已完全更新,但仍然給我錯誤,表明您的C編譯器無法正常工作,任何人都可以給我建議如何克服它。
[root@localhost libxml2-2.8.0]# ./configure
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/root/tmpdir/libxml2-2.8.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
只是一些評論,不一定是解決方案...不要將root用於日常使用(對我而言,編譯libxml2是日常情況)。 我建議創建一個“普通”用戶,並使用它在您的計算機上工作。 configure
,與該用戶make
,然后sudo make install
。
然后,根據您的Linux,幾乎可以確定有一個用於libxml2和libxml2-devel的軟件包。 嘗試安裝它,而不是手動編譯。 一段時間后通過編譯方法進行安裝會給您的計算機帶來混亂...
編輯:要回答您的評論:
(在這里確定您的體系結構,選擇正確的最后一列)
您可能需要或不需要sudo ...如果您以root身份運行此文件,則將不需要它。
如在您的輸出中, C compiler cannot create executables
您可以在配置文件中使用gcc編譯簡單的c文件嗎,它檢查以下內容
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
沒有-o選項的gcc是否提供可執行文件
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.