简体   繁体   English

在windows7上使用mingw32编译Qt 4.8.5:“没有这样的文件或目录”

[英]Compiling Qt 4.8.5 using mingw32 on windows7: “no such file or directory”

I'm trying to build qt-4.8.5 (opensource) from source using mingw32 compiler on windows 7. 我正在尝试使用Windows 7上的mingw32编译器从源代码构建qt-4.8.5(opensource)。

"configure" works fine, but compilation (mingw32-make) fails with this output: “configure”工作正常,但编译(mingw32-make)失败并输出:

D:\development\qt-4.8.5-mingw>mingw32-make                                                                                      
cd src/tools/bootstrap/ && D:/development/MinGW/bin/mingw32-make.EXE -f Makefile                                                
mingw32-make.EXE[1]: Entering directory 'd:/development/qt-4.8.5-mingw/src/tools/bootstrap'                                     
D:/development/MinGW/bin/mingw32-make.EXE -f Makefile.Release                                                                   
mingw32-make.EXE[2]: Entering directory 'd:/development/qt-4.8.5-mingw/src/tools/bootstrap'                                     
g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE     -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -DQT_NO_DEPRECATED -DQT_NODLL -I'../../../include' -I'../../../include/QtCore' -I'../../../include/QtXml' -I'../../3rdparty/zlib' -I'd:/development/MSVS2008EXP/VC/INCLUDE' -I'd:/development/Microsoft SDKs/Windows/v6.1/include' -I'd:/development/MSVS2008EXP/VC/lib/' -I'd:/development/MS_SDKs/Windows/v6.1/Lib' -I'd:/DXSDK/Lib/x86' -I'../../../mkspecs/win32-g++-4.6' -o tmp/obj/release_shared/qisciicodec.o ../../corelib/codecs/qisciicodec.cpp                                                                          
g++: error: CreateProcess: No such file or directory                                                                            
Makefile.Release:333: recipe for target 'tmp/obj/release_shared/qisciicodec.o' failed                                           
mingw32-make.EXE[2]: *** [tmp/obj/release_shared/qisciicodec.o] Error 1                                                         
mingw32-make.EXE[2]: Leaving directory 'd:/development/qt-4.8.5-mingw/src/tools/bootstrap'                                      
Makefile:34: recipe for target 'release' failed                                                                                 
mingw32-make.EXE[1]: *** [release] Error 2                                                                                      
mingw32-make.EXE[1]: Leaving directory 'd:/development/qt-4.8.5-mingw/src/tools/bootstrap'                                      
Makefile:68: recipe for target 'sub-tools-bootstrap-make_default-ordered' failed                                                
mingw32-make.EXE: *** [sub-tools-bootstrap-make_default-ordered] Error 2                                                        

Ie: 即:

g++: error: CreateProcess: No such file or directory                                                                            

Because g++ DOESN'T print which file it can't find, I'm not certain what could be causing this. 因为g ++不打印它找不到的文件,所以我不确定是什么导致了这个。 I can call g++, gcc and mingw32-make from command line and they're in Path. 我可以从命令行调用g ++,gcc和mingw32-make,它们在Path中。 I've removed VC directories, MS SDK directories, and this doesn't fix the problem either. 我删除了VC目录,MS SDK目录,这也没有解决问题。 This is a clean "install", I extracted tar.gz contents, and run configure without modifying anything. 这是一个干净的“安装”,我提取了tar.gz内容,并在不修改任何内容的情况下运行configure。 Adding mingw include path via -I switch to configure doesn't fix the problem. 通过-I开关添加mingw include路径来配置不能解决问题。

How do I fix this? 我该如何解决?

Additional info : 附加信息
g++ version: 4.7.1 g ++版本:4.7.1
mingw32-make version: 3.82.90 mingw32-make版本:3.82.90

Figured it out. 弄清楚了。 (Well, I still don't know what was causing this, but I know how to make it work). (好吧,我仍然不知道造成这种情况的原因,但我知道如何让它发挥作用)。

Solution: 解:

  1. Place qt.conf into qt "bin" directory. 将qt.conf放入qt“bin”目录。

     [Paths] Prefix = d:/development/qt-4.8.5-mingw 

    Prefix is path of your qt installation (notice forward slashes). 前缀是qt安装的路径(注意正斜杠)。

  2. Configure and compile using bat files: 使用bat文件配置和编译:

    1. To configure: 要配置:

       set QTDIR=D:\\development\\qt-4.8.5-mingw set QMAKESPEC=win32-g++ set PATH=D:\\development\\MinGW\\bin;D:\\development\\tools\\Perl32\\bin;D:\\development\\qt-4.8.5-mingw\\bin set PATH=%PATH%;c:\\Windows\\system32 set INCLUDE= set LIB= set CPATH= set CPLUS_INCLUDE_PATH= set LANG=en configure -opensource -openssl 

      You should put into path bin directory of 32bit perl, bin directory of mingw32 installation, and bin directory of qt installation. 你应该放入32bit perl的路径bin目录,mingw32安装的bin目录,以及qt安装的bin目录。 -openssl key is optional (I need this one). -openssl键是可选的(我需要这个)。

    2. To compile: 编译:

       set QTDIR=D:\\development\\qt-4.8.5-mingw set QMAKESPEC=win32-g++ set PATH=D:\\development\\MinGW\\bin;D:\\development\\tools\\Perl32\\bin;D:\\development\\qt-4.8.5-mingw\\bin set PATH=%PATH%;c:\\Windows\\system32 set INCLUDE= set LIB= set CPATH= set CPLUS_INCLUDE_PATH= set LANG=en mingw32-make 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM