User forums > Help

Problem when compiling Qt3.3.3 app...

(1/2) > >>

Mage2k:
Hi, I'm hoping one of you guys can help me out.  I'm trying to get Qt (3.3.3) apps building in C::B.  What I've done so far is to set the compiler to use makefiles under compiler settings, and added the following to the pre-build options for my project:

qmake -project
qmake

So, that gets executed ok and the Makefile is created by qmake.  However, when it begins compiling I get errors indicating that the various qt include files (e.g. qvbox.h, et...) don't exist.  I have verified that I can build the project with the created Makefile from the command line by directly invoking make and that the proper include directories are set under the projects compiler directories.  Any ideas?

Mage2k

mandrav:
If you 're using a custom makefile (i.e. not C::B generated), all C::B does is launch 'make -f <yourmakefile>'. No other setting in C::B takes effect.
You are using a custom makefile, yes?
You have checked "This is a custom makefile" in project properties, yes?

Mage2k:
Well, given the two choices;

"This is a custom makefile":  in this case if none of the other settings in C::B takes effect, then qmake will not be run and no makefile will be generated.

Not using "This is a custom makefile":  in this case qmake is run and the Makefile is created and I get the above listed problem.

So, I've tried something else:

Change the qmake commands to

qmake -project
qmake "TARGET=default"

for ease of target use.

Unset the use custom makefile setting and build, I get the makefile built and the compile errors as noted previously.  Then I set the custom makefile setting and build, everything gets built, but the program doesn't actually run.  Then, when I choose Run again, C::B tells me the project hasn't been built and asks if I want to build it.  I say yes and it tells me that there is nothing to be done for default (the target).  I check, and yes, the app has been built, and I can run it from the terminal, but I can't run it from within C::B.

So, the problem here seems to be that I need a way to invoke qmake from within C::B in order to generate a the custom Makefile -- but, if I use a custom Makefile, then the pre-build commands don't get executed...

Also, if I don't use a custom makefile, am I to understand the C::B will generate one?  Where is it?  I certainly don't see it, the only one that is there is the one generated by qmake.

Mage2k

Mage2k:
Ok, I figured out why the errors are coming up when not using the custom makefile even though I have the correct directories specified via the system variable $QTDIR:  when g++ is run using makefiles (as opposed to directly), it chops off the first letter of QTDIR, i.e.:

g++    -ITDIR/include -I/usr/include -c lcdrange.cpp -o .objs/lcdrange.o

rather than

g++    -IQTDIR/include -I/usr/include -c lcdrange.cpp -o .objs/lcdrange.o

I can get around this by explicitly specifying the include dir in the build settings (although I still don't know how to be able to use qmake), but this seems like a bona-fide bug (note that this doesn't happen when invoking the compiler directly (not using make).  Should I report this or is it known?

Mage2k

mandrav:
If you don't specify your makefile as a custom makefile, then C::B will generate one on the fly (in your temporary directory). This means you makefile will not be used. I can see you 're in a dead-lock here in that you want C::B to run your pre-processing steps but still at the same time use a custom makefile. This is not possible, because the pre-processing steps are part of the generated makefile...
Please submit a feature request for this.

Navigation

[0] Message Index

[#] Next page

Go to full version