我在這裏完全不知所措。Cmake拒絕找到正確的MinGW文件夾
我有一個使用CMake的C++項目。它曾經工作,但最近出現了一些奇怪的問題,所以我決定重新安裝Qt SDK和CMake。不過,現在試圖建立一個文件時,我得到以下錯誤:
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "C:/Qt/Qt5.0.1/Tools/MinGW/bin/gcc.exe" is not able to
compile a simple test program.
It fails with the following output:
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
CMake Error: your C compiler: "C:/Qt/Qt5.0.1/Tools/MinGW/bin/gcc.exe" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "C:/Qt/Qt5.0.1/Tools/MinGW/bin/g++.exe" was not found. Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
CMake Error: your C compiler: "C:/Qt/Qt5.0.1/Tools/MinGW/bin/gcc.exe" was not found. Please set CMAKE_C_COMPILER to a valid compiler path or name.-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Check for working C compiler: C:/Qt/Qt5.0.1/Tools/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/Qt/Qt5.0.1/Tools/MinGW/bin/gcc.exe -- broken
-- Configuring incomplete, errors occurred!
這完全博格爾斯我的腦海裏。 MinGW位於C:/Qt/Qt5.0.2/Tools/
,而不是Qt5.0.1
。我告訴它,以便在的CMakeLists.txt文件:
SET(CMAKE_C_COMPILER C:/Qt/Qt5.0.2/Tools/MinGW/bin/gcc)
SET(CMAKE_CXX_COMPILER C:/Qt/Qt5.0.2/Tools/MinGW/bing++)
我什至增加C:/Qt/Qt5.0.2/Tools/MinGW/bin/
全球PATH
變量,但是這並沒有幫助任何。 CMake一直認爲它應該在Qt5.0.1
- 一個不存在的文件夾。
有沒有人知道我可能會忽略哪個選項?我已經嘗試了一切。
嘗試刪除您的構建目錄並嘗試在新目錄中構建您的項目。或者只是刪除build目錄中的CMakeCache.txt。 –
PATH還有什麼,它的順序是什麼? – Sqeaky
使用Qt時,CMake將使用'qmake'指向的路徑並假定它們是正確的。 CMake是否有可能從舊安裝中找到'qmake'?當它執行FindQT命令時,會發現哪個'qmake'? – SethMMorton