2015-03-31 35 views
0

我已經檢查了互聯網,但找不到任何有用的東西。Qt Creator不會構建最小化項目[-c line 0:git]

我剛從他們的主頁安裝了最新的Qt。然後我創建了Creator並創建了一個「qt控制檯應用程序」。我的項目設置過程中留下的一切標準,然後我擊築,我得到了以下錯誤消息,在那裏我完全以丟失,因爲它不作任何SENCE對我說:

程序代碼

#include <QCoreApplication> 
int main(int argc, char *argv[]) 
{ 
    QCoreApplication a(argc, argv); 

    return a.exec(); 
} 

內建問題

"\Program Files (x86)\Git\bin\sh.exe":-1: Error: -c: line 0: syntax error near unexpected token `(' 

"\Program Files (x86)\Git\bin\sh.exe":-1: Error: -c: line 0: `/Program Files (x86)/Git/bin/sh.exe -c g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_CORE_LIB -I"..\CyberGloves" -I"." -I"..\..\..\..\Qt\5.4\mingw491_32\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtCore" -I"debug" -I"..\..\..\..\Qt\5.4\mingw491_32\mkspecs\win32-g++" -o debug\main.o ..\CyberGloves\main.cpp' 

編譯器窗口 以下是編譯器窗口消息

"/Program Files (x86)/Git/bin/sh.exe": -c: line 0: syntax error near unexpected token `(' 
"/Program Files (x86)/Git/bin/sh.exe": -c: line 0: `/Program Files (x86)/Git/bin/sh.exe -c g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_CORE_LIB -I"..\CyberGloves" -I"." -I"..\..\..\..\Qt\5.4\mingw491_32\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtCore" -I"debug" -I"..\..\..\..\Qt\5.4\mingw491_32\mkspecs\win32-g++" -o debug\main.o ..\CyberGloves\main.cpp' 
Makefile.Debug:172: recipe for target 'debug/main.o' failed 
mingw32-make[1]: *** [debug/main.o] Error 258 
mingw32-make[1]: Leaving directory 'C:/Users/fihle/Documents/build-CyberGloves-Desktop_Qt_5_4_1_MinGW_32bit-Debug' 
makefile:34: recipe for target 'debug' failed 
mingw32-make: *** [debug] Error 2 
11:46:15: Der Prozess "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe" has been terminated with the return value 2. 

的摘錄以及所有我看到的是他的困擾大約GIT,當時我甚至沒碰過它(正如我所說的,我把它剛開箱即可)。

我在Win7-64位機器上使用QT社區版本。

我希望你們中的一些人有一個主意。

感謝您的支持。

+0

我想你最好使用MinGW編譯器套件與Qt。 – 2015-03-31 10:20:14

+0

@PraneethNilangaPeiris能否比Qt在安裝過程中自己設置的更好? – user3085931 2015-03-31 10:22:39

+0

你已經安裝了git,你正在使用它的shell。由於換行符不同,它可能不符合mingw的二進制文件。 – molbdnilo 2015-03-31 10:22:47

回答

2

從%PATH%環境變量中刪除c:/ Program Files(x86)/ Git/bin,並確保QT安裝和項目目錄不在任何具有空格或任何特殊字符的目錄中。

+0

這是工作。但是,我現在不用git,或者更可能依賴於git的其他程序出現問題嗎? – user3085931 2015-03-31 10:32:08

+1

你應該在你的git安裝文件夾中有一個cmd文件夾。將其添加到您的%path%環境中,並可以通過其他程序再次找到git。 Qt Creator將在您的環境中使用此路徑。 – user3779331 2015-04-01 05:28:42