1. 程式人生 > >configure編譯時,出現 configure: error: C compiler cannot create executables錯誤解決

configure編譯時,出現 configure: error: C compiler cannot create executables錯誤解決

我們在編譯軟體的時候,是不是經常遇到下面的錯誤資訊呢?

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.

有很多人建議重灌GCC,但是確無濟於事。

這個錯誤產生的原因其實很簡單: 由於我們在編譯軟體之前,進行了export操作,改變了CFLAGS和LIBS的值。

這個時候只要講這個值清空就可以了。 

在linux的命令列中,輸入下面的兩行,清空CFLAGS和LIBS的值:

export LIBS=

export CFLAGS=

然後,就再執行./configue 等時,就可以正常通過了。