Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-interest Archive, August 2006
Compiling in release mode


Message 1 in thread

Hi everybody!

I'm having some problems compiling "Hello Qt" in release mode.

I type "qmake -project" and the file "hello.pro" is generated. Then I edit this file by adding the line "CONFIG = release". Then I enter "qmake hello.pro" and when I type "make", the following is displayed:
----------
        g++ -c -D_HPUX_SOURCE -DGLU_VERSION_1_2 -O2   -I../qt/mkspecs/hpux-g++ -I. -I. -o hello.o hello.cpp
hello.cpp:1:26: qapplication.h: No such file or directory
hello.cpp:2:20: qlabel.h: No such file or directory
hello.cpp: In function `int main(int, char**)':
hello.cpp:6: error: `QApplication' undeclared (first use this function)
hello.cpp:6: error: (Each undeclared identifier is reported only once for each function it appears in.)
hello.cpp:6: error: expected `;' before "app"
hello.cpp:7: error: `QLabel' undeclared (first use this function)
hello.cpp:7: error: `label' undeclared (first use this function)
hello.cpp:7: error: `QLabel' has not been declared
hello.cpp:10: error: `app' undeclared (first use this function)
*** Error exit code 1

Stop.
----------
What's strange is that everything goes well if I don't perform that extra step of editing "hello.pro". Specifically the compilation command line is way more complete, with more include directories:
----------
        g++ -c -D_HPUX_SOURCE -DGLU_VERSION_1_2 -g -Wall -W -D_POSIX_C_SOURCE=199506L  -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../qt/mkspecs/hpux-g++ -I. -I../qt/include/QtCore -I../qt/include/QtGui -I../qt/include -I. -I. -I. -o hello.o hello.cpp
        g++ -Wl,+s -Wl,+b,/home/dcwt/xti-mp/qt/lib -o hello hello.o    -L/home/dcwt/xti-mp/qt/lib -lQtGui_debug -L/home/dcwt/xti-mp/qt-x11-opensource-src-4.1.4/lib -L/usr/lib/X11R6 -lSM -lICE -lXi -lXext -lX11 -lQtCore_debug -lz -lm -ldld -lpthread
----------
Does anyone has na idea of what's going on?

BTW, I'm using:
	* HP-UX B.11.11 U
	* gcc 3.4.2
	* Qt 4.1.4

Thanks in advance,

André

--
 [ signature omitted ] 

Message 2 in thread

On 03.08.06 17:27:14, Rodrigues.External@xxxxxxxxxxx wrote:
> I type "qmake -project" and the file "hello.pro" is generated. Then I edit this file by adding the line "CONFIG = release". Then I enter "qmake hello.pro" and when I type "make", the following is displayed:
> ----------
>         g++ -c -D_HPUX_SOURCE -DGLU_VERSION_1_2 -O2   -I../qt/mkspecs/hpux-g++ -I. -I. -o hello.o hello.cpp
> hello.cpp:1:26: qapplication.h: No such file or directory
> hello.cpp:2:20: qlabel.h: No such file or directory
> hello.cpp: In function `int main(int, char**)':
> hello.cpp:6: error: `QApplication' undeclared (first use this function)
> ----------
> Does anyone has na idea of what's going on?

Yes, you didn't read the qmake manual close enough. You reset the CONFIG
variable to only include "release", which tells qmake to produe a
Makefile for a simple c++ program in release mode. What you also want is
to add the value "qt" to CONFIG. So CONFIG = qt release should get you
started, although you might also want to add warn_on and thread.

Andreas

-- 
 [ signature omitted ]