PDA

View Full Version : Problem with a makefile



Tweety
15th February 2006, 12:15
I tried to run a project with 2 source files and a header file and there was some kind of problem with the linking (as the modules compile successfully separately). Moreover, the files were from a Qt tutorial so they should work...
So I thought I'd create a makefile and then use make (btw i use mingw make). So eventually I created the makefile with qmake and then when I typed make in the command line I got this error message: "mingw32-make:*** No targets specified and no makefile found.Stop.". Then I tried make -f makefile and it said: "makefile:65:*** multiple target patterns. Stop.". And from this point on I didn't know what else to do.
Other technical details: I use Windows XP, Qt 4.1, MinGW 5.0.2

I will attach the makefile and maybe someone will spot the problem.
Thanks in advance.

jacek
15th February 2006, 14:59
Your Makefile doesn't contain any rules that generate code --- your .pro file must be wrong. Could you post it?

Tweety
15th February 2006, 15:15
Yep sure. Here it is:

jacek
15th February 2006, 15:25
Add "TEMPLATE = app", run "qmake QTapp.pro" and then make.

Tweety
15th February 2006, 15:29
I get the same error message.... :(
Could it be a problem with MinGW?

jacek
15th February 2006, 15:34
What files do you have in your project directory?

Tweety
15th February 2006, 15:46
The files in the project directory are: lcdrange.h, lcdrange.cpp and main.cpp.

Tweety
15th February 2006, 16:04
I eventually got to a more radical solution: I just deleted the lines in the makefile from line 65 to the end and it worked :D . But it's still kind of a mystery why it wouldn't work in the first place.

ovidiu.sabou
15th February 2006, 16:10
qmake generates paths that contain colons; Since microsoft operating systems have paths with the syntax drive:path the colon is interpreted by make as a separator instead of being part of the path.

The problem is either in your version of make(because it doesn't interpret that colon as expected) or in qmake because it generates a bad Makefile.

It's strange that you are using mingw which is said to be supported by open source Qt.

Maybe you should try with make from MSYS but still I don't understand why it doesn't work with mingw32-make.

jacek
15th February 2006, 16:17
The files in the project directory are: lcdrange.h, lcdrange.cpp and main.cpp.
Where is the .pro file?

jacek
15th February 2006, 16:19
Maybe you should try with make from MSYS but still I don't understand why it doesn't work with mingw32-make.
There are some problems with MSYS. Anyway, Qt4 should work without any problems with MinGW and cmd.exe.

Tweety
15th February 2006, 16:21
Where is the .pro file?

The .pro file is in the exact same directory.

jacek
15th February 2006, 16:33
The .pro file is in the exact same directory.
This is really strange. How do you invoke qmake? What is the current directory?

Tweety
15th February 2006, 19:19
I invoke qmake with "qmake -o Makefile QTapp.pro" in the directory where the .pro file is located.

wysota
15th February 2006, 19:36
Did you try deleting Makefile before running qmake?

Tweety
15th February 2006, 20:03
I tried not to use the make that came with mingw and instead I used the make in CodeBlocks and it works. So I guess something was wrong with mingw make...
Anyway, at least it works now, so I can start "playing" with Qt :D

yop
15th February 2006, 20:34
I tried not to use the make that came with mingw and instead I used the make in CodeBlocks and it works. So I guess something was wrong with mingw make...
Anyway, at least it works now, so I can start "playing" with Qt :D
If you don't have two installations of MinGW then Code::Blocks is using the same "make" executable you invoked from the command line.

Did you try deleting Makefile before running qmake?
Most probably that was the issue. If I do qmake -spec linux-g++ and then qmake -spec linux-icc I get the gcc Makefile again , I have to manually delete it to get the one for icc.