2015-05-05 75 views
-1

我要建立的貝葉斯優化程序錯誤是cmake的建立自己的錯誤的C++

The C compiler identification is GNU 4.9.2 
The CXX compiler identification is GNU 4.9.2 
Check for working C compiler: C:/MinGW/bin/gcc.exe 
CMake Error: Generator: execution of make failed. Make command was: "C:\MinGW\bin" "cmTryCompileExec2576605559/fast" 
Check for working C compiler: C:/MinGW/bin/gcc.exe -- broken 
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/CMakeTestCCompiler.cmake:61 (message): 

C編譯器「C:/MinGW/bin/gcc.exe」不能夠編譯一個簡單的測試程序 。

它失敗,出現以下的輸出:

Change Dir: C:/Code-Lite-Test/CMakeFiles/CMakeTmp 
Run Build Command:"C:\MinGW\bin" "cmTryCompileExec2576605559/fast" 
Access is denied 
Generator: execution of make failed. Make command was: "C:\MinGW\bin" 
"cmTryCompileExec2576605559/fast" 
CMake will not be able to correctly generate this project. 
Call Stack (most recent call first): 

我已經下載源來自URL https://bitbucket.org/rmcantin/bayesopt/,我已經下載了MinGW的編譯器的Windows,當我嘗試建立該程序的錯誤是:

請在我嘗試構建貝葉斯優化時,我也刪除了舊的緩存。

回答

2

您可以嘗試首先編譯一個簡單的C++程序,而不使用CMake。例如。具有以下內容存儲簡單main.cpp某處在用戶目錄C:\Users\<yourname>\Temp目錄:

現在打開CMD窗口在C:\Users\<yourname>\Temp目錄並運行:

C:\MinGW\bin\gcc.exe main.cpp -o testprog 

如果錯誤彈出看來,是說一些關於在您的CMD窗口中運行以下命令並嘗試重新編譯:

set PATH=%PATH%;C:\MinGW\bin 

如果必須運行最後一個命令,請永久添加C:\ MinGW \ bin路徑。畢竟應該可以使用MinGW作爲編譯器運行CMake

+0

當我嘗試我得到這樣的錯誤 C:\> gcc.exe main.cpp -o testprog c:/ mingw/bin /../ lib/gcc/x86_64-w64-mingw32/4.9。 2 /../../../../ x86_64-w64-mingw32/ bin/ld.exe:無法打開輸出文件testprog.exe:權限被拒絕 collect2.exe:錯誤:ld返回1退出狀態 –

+0

您的權限似乎存在問題。也許你會在用戶目錄中的一個目錄中嘗試C:\ Users \ yourname \ temp – tomvodi

+0

我已經將Mingw移到了uesr目錄中,同樣的錯誤也顯示出來了。 –

1

確認您的MinGW編譯器的Windows是能夠建立一個簡單的程序沒有 CMake的,例如:

當它工作,清理緩存,然後再試一次。

相關問題