我第一次尝试使用Qt Creator,但我无法让Hello World运行。这就是我的工具包的样子:
Name: MyKit
File system name: MyKitFileSystemName
Device type: Desktop
Device: Local PC
Sysroot: (blank)
Compiler: (long path leading to mingw32\bin\g++.exe)
Environment: No changes.
Debugger: (long path leading to mingw32\bin\gdb.exe)
Qt version: 5.7.0 MSVC2015 64bit
Qt mkspec: (blank)
CMake Tool: (long path leading to cmake\bin\cmake.exe)
CMake Generator: CodeBlocks - MinGW Maketiles
CMake Configuration: (left this as default)
我应该注意一些关于套件的事情。如果我使用自动检测的套件,我无法选择我的编译器。套件旁边还有一个红色八边形,我不确定这意味着什么。
当我尝试运行Hello World程序时(来自https://wiki.qt.io/Qt_for_Beginners),我遇到以下问题:
[debug] Error 258
这是输出:
15:08:56: Running steps for project myProject...
15:08:56: Configuration unchanged, skipping qmake step.
15:08:56: Starting: "C:\Program Files (x86)\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin\mingw32-make.exe"
C:/Program Files (x86)/mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0/mingw32/bin/mingw32-make -f Makefile.Debug
/usr/bin/sh: -c: line 0: syntax error near unexpected token `('
/usr/bin/sh: -c: line 0: `C:/Program Files (x86)/mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0/mingw32/bin/mingw32-make -f Makefile.Debug'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 258
15:08:58: The process "C:\Program Files (x86)\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project myProject (kit: MyKit)
When executing step "Make"
快速搜索之后,我发现了这条建议:“从%PATH%环境变量中删除c:/ Program Files(x86)/ Git / bin,并确保QT安装和项目目录不在任何目录中空格或任何特殊字符“。
Git不在我的PATH中,QT安装目录或项目目录中没有空格或特殊字符(尽管编译器路径中有空格)。
我做错了什么?我最好的猜测是编译器存在问题。该路径有“mingw-w64”和“mingw32”所以我不确定它是32位还是64位。我猜它如果是32位就行不通。
我希望我遗漏了一些明显的东西,以便轻松解决这个问题!