2015-03-31 31 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