PDA

View Full Version : Attemping to use Qt 4.6 breaks make command



ajoffe
4th December 2009, 01:14
The other day I decided to try installing Qt 4.6.0 from the SDK binary download. I already had an existing install of MinGW, located in C:\MinGW, so I chose not to install the bundled copy of MinGW. Other than that, I chose the default configuration for the rest of the Qt 4.6 installation, and it completed without any problems. I then updated my Qt-related path variables, which previously pointed to my existing Qt 4.5.0 installation directory in C:\Qt\2009.01, to point to the new Qt 4.6.0 installation in C:\Qt\2009.05. I did not change my MinGW environment variable, which remains set to C:\MinGW\bin.

The problem is that when I now try to use the make command in any context, I get an error saying that it can't be found. If I revert my Qt environment variables to point back to the 4.5 installation in C:\Qt\2009.01, make works again. What is the problem here?

Thanks.

wysota
4th December 2009, 09:04
See the contents of your PATH variable. It probably doesn't contain the directory with make.

ajoffe
4th December 2009, 17:00
OK this is my current PATH:


PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Sys tem32\Wbem;C:\Qt\2009.05\bin;C:\Qt\2009.05\qt\bin; C:\MinGW\bin;C:\Program Files\Mercurial

What is missing?

wysota
4th December 2009, 17:15
How should I know? :) Where is "make" in your system?

toreo
4th December 2009, 17:47
Are you sure you actually have make? Have you used make in your mingw environment previously? The MinGW distributed with Qt has mingw32-make.exe, since it's strictly not a fully functional make (i.e doesn't support parallelized builds etc). I'm pretty sure (although I'm on a mac right now and can't check) that make is part of MSYS, not MinGW.

I've gotten used to typing mingw32-make to remind myself that I'm working in an inferior while in Windows. ;-)

ajoffe
4th December 2009, 18:09
OK I think I figured out what is happening. When I use the 4.5 installation, "make" is actually a batch file, C:\Qt\2009.01\qt\bin\make.bat, which internally calls mingw32-make, which is located in C:\MinGW\bin. For some reason, the 4.6 installation does not have this same batch file in C:\Qt\2009.05\qt\bin. Did something change between 4.5 and 4.6 as far as the preferred way to execute makefiles?

toreo
4th December 2009, 18:24
2009.01 was the last version with make.bat. I remember creating a bat file myself for 2009.02, but had problems getting Eclipse to execute it (apparently it would only spawn real executables) so I ended up copying mingw32-make.exe to make.exe. Learning later about the background of mingw32-make and its lack of features, I have since dropped making this customization.

Just accepting this fact and dealing with mingw32-make will also make any build scripts you make run on default Windows Qt installations without problems, so I think that's the appropriate action.

-Tore

ajoffe
4th December 2009, 20:37
Thanks toreo for shedding some light on this.


2009.01 was the last version with make.bat.
I see, so do we now have to type "mingw32-make" every time to compile? Any ideas why the bat file was removed?


Learning later about the background of mingw32-make and its lack of features, I have since dropped making this customization.
Where can I read about these issues? Is it ever advisable to use anything other than mingw32-make?

Thanks.

toreo
4th December 2009, 21:30
I see, so do we now have to type "mingw32-make" every time to compile? Any ideas why the bat file was removed?


Where can I read about these issues? Is it ever advisable to use anything other than mingw32-make?

I don't know why the bat file was removed (haven't seen any official comment by Nokia on it), but I can guess that it was to avoid confusion with the POSIX make that comes with MSYS. The POSIX make tool will expect POSIX style paths and requires either MSYS (i.e /c/src/myproj) or Cygwin (i.e /cygdrive/c/src/myproj) as opposed to Windows drive letters and backslashes. Attempting to combine the two path styles normally result in massive headaches and broken builds.

mingw32-make has fewer dependencies than a POSIX make and can be run from cmd.exe. So it's a quicker, simpler solution that supports Windows paths and is supported by default from Nokia's distribution. To have qmake generate makefiles with POSIX paths you have to rebuild qmake as well. You will find more information about this by googling for "qt msys" for instance. Depending on your choice of IDE it may or may not be possible to get it to build using MSYS. That would give you a more powerful shell to work in, and your make tool would support parallel builds, but it will take some work to get there. YMMV.

There's a brief and vague mention on the difference between mingw32-make and make in the MinGW FAQ, other than that I guess the source code and googling are your best options for learning more.

-Tore

ajoffe
4th December 2009, 21:44
Thanks for explaining, that makes sense. I don't use MSYS but I can see why the old make.bat would be problematic in that context.