简体   繁体   中英

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.

"configure" works fine, but compilation (mingw32-make) fails with this output:

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. I can call g++, gcc and mingw32-make from command line and they're in Path. I've removed VC directories, MS SDK directories, and this doesn't fix the problem either. This is a clean "install", I extracted tar.gz contents, and run configure without modifying anything. Adding mingw include path via -I switch to configure doesn't fix the problem.

How do I fix this?

Additional info :
g++ version: 4.7.1
mingw32-make version: 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.

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

    Prefix is path of your qt installation (notice forward slashes).

  2. Configure and compile using bat files:

    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. -openssl key is optional (I need this one).

    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 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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