I have finished the installation process, using the batch file "configure-mingw.bat", with success, but C::B won't compile the tutorial 1 of the qt.
I removed the qt4 installation and I modified the PATH because was "C:\QT\4.2.2" now is C:\INSTALLQT3.
PATH=.......;C:\MinGW\bin;c:\installqt3\bin;C:\installqt3\include
Just for info I am using the last nightly build, that with QT4 was building perfectly.
the error I got is :
Compiling: C:\installqt3\tutorial\t1\main.cpp
C:\installqt3\tutorial\t1\main.cpp:7:26: qapplication.h: No such file or directory
C:\installqt3\tutorial\t1\main.cpp:8:25: qpushbutton.h: No such file or directory
C:\installqt3\tutorial\t1\main.cpp: In function `int main(int, char**)':
C:\installqt3\tutorial\t1\main.cpp:13: error: `QApplication' undeclared (first use this function)
C:\installqt3\tutorial\t1\main.cpp:13: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:\installqt3\tutorial\t1\main.cpp:13: error: expected `;' before "a"
C:\installqt3\tutorial\t1\main.cpp:15: error: `QPushButton' undeclared (first use this function)
C:\installqt3\tutorial\t1\main.cpp:15: error: expected `;' before "hello"
C:\installqt3\tutorial\t1\main.cpp:16: error: `hello' undeclared (first use this function)
C:\installqt3\tutorial\t1\main.cpp:18: error: `a' undeclared (first use this function)
Process terminated with status 1 (0 minutes, 0 seconds)
9 errors, 0 warnings
Thanks
Stefano
Thanks a lot Mandrav.
So, if I have understood well, adding to the Global Compiler Variable :
Base : C:\installqt3
Include : C:\installqt3\include
lib : C:\installqt3\lib
and specifying in the compiler and debugger settings :
$(#qt)
$(#qt.include)
$(#qt.lib)
would be what you told me. Right?
It seems to look at this directories but don't seems to be enough.
C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:13: undefined reference to `_imp___ZN12QApplicationC1ERiPPc'
:C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:15: undefined reference to `_imp___ZN7QStringC1EPKc'
:C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:15: undefined reference to `_imp___ZN11QPushButtonC1ERK7QStringP7QWidgetPKc'
:C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:16: undefined reference to `QPushButton::resize(int, int)'
:C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:18: undefined reference to `QApplication::setMainWidget(QWidget*)'
:C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:19: undefined reference to `QWidget::show()'
:C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:20: undefined reference to `_imp___ZN12QApplication4execEv'
:C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:20: undefined reference to `QPushButton::~QPushButton()'
:C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:20: undefined reference to `QApplication::~QApplication()'
:C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:20: undefined reference to `QPushButton::~QPushButton()'
:C:\Documents and Settings\negros.CONTROLLI\Documenti\CodeBlocks\QT3-Tutorial1\main.cpp:20: undefined reference to `QApplication::~QApplication()'
C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QString11shared_nullE'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN11QStringData10deleteSelfEv'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Eii'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Eii'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Ev'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Ev'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Ei'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Ei'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2ERKS_'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2ERKS_'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayD2Ev'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayD2Ev'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayD2Ev'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray6assignERKS_'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray6resizeEj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray6resizeEjNS_12OptimizationE'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray6resizeEj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray4fillEPKcij'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray9duplicateERKS_'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray6assignERKS_'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray6assignEPKcj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray9duplicateERKS_'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray9duplicateEPKcj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray10setRawDataEPKcj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray12resetRawDataEPKcj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZNK7QGArray4findEPKcjj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZNK7QGArray8containsEPKcj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray4sortEj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZNK7QGArray7bsearchEPKcj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArray9msg_indexEj'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZNK7QGArray7isEqualERKS_'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZNK7QGArray7isEqualERKS_'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Eii'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Eii'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Ev'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Ev'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Ei'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2Ei'
:C:\installqt3\include\qvaluelist.h:: undefined reference to `_imp___ZN7QGArrayC2ERKS_'
:: More errors follow but not being shown.
:: Edit the max errors limit in compiler options...
:: === Build finished: 50 errors, 0 warnings ===
Obviously the Tutorial 1 it's very very simple.
**
** Qt tutorial 1
**
****************************************************************/
#include <qapplication.h>
#include <qpushbutton.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
a.setMainWidget( &hello );
hello.show();
return a.exec();
}
Thanks in advance for any comments.
Stefano
I use Qt3 with Visual Studio 6.
The line added to the dsp file (the project file of VS) to link the libs is (release and debug version):
[RELEASE VERSION]
# ADD LINK32 "qt-mt334.lib" "qtmain.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "opengl32.lib" "glu32.lib" "delayimp.lib" delayimp.lib /nologo /subsystem:windows /machine:IX86 /libpath:"$(QTDIR)\lib" /DELAYLOAD:comdlg32.dll /DELAYLOAD:oleaut32.dll /DELAYLOAD:winmm.dll /DELAYLOAD:wsock32.dll /DELAYLOAD:winspool.dll
[DEBUG VERSION]
# ADD LINK32 "qt-mt334.lib" "qtmain.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "imm32.lib" "winmm.lib" "wsock32.lib" "winspool.lib" "opengl32.lib" "glu32.lib" "delayimp.lib" /nologo /subsystem:windows /debug /machine:IX86 /pdbtype:sept /libpath:"$(QTDIR)\lib"
May be it is too long, but you can see that the Qt3 lib is "qt-mt334.lib". You should have a similar library that must be added to your project options. Note that "334" is the version (I use 3.3.4), that may change. Note also that "mt" means multi-threaded and also this depends on how you compiled your library (mt is the default mode).
I hope this helps!
Alessandro
Uhm... I believe this is the point.
I did again "compile-MinGW.bat" to see if it was lissed womething during the compilation process, and at the end I see :
"The Qt library is now built in ./lib"
"The Qt examples are built in the directories in ./examples"
"The Qt tutorials are built in the directories in ./tutorial"
ECHO disattivato.
"Enjoy! - the Trolltech team"
ECHO disattivato.
mingw32-make[1]: Leaving directory `C:/installqt3'
C:\installqt3>dir /lib
Formato del parametro non corretto - "lib".
C:\installqt3>dir \lib
Il volume nell'unità C è MAIN
Numero di serie del volume: 505E-1421
Directory di C:\
File non trovato
C:\installqt3>dir .\lib
Il volume nell'unità C è MAIN
Numero di serie del volume: 505E-1421
Directory di C:\installqt3\lib
23/01/2007 11.07 <DIR> .
23/01/2007 11.07 <DIR> ..
23/01/2007 11.04 86.952.820 libdesignercore.a
25/01/2007 12.42 901 libdesignercore.prl
23/01/2007 11.07 10.586.662 libeditor.a
25/01/2007 12.42 854 libeditor.prl
23/01/2007 10.44 791.062 libqassistantclient.a
25/01/2007 12.42 865 libqassistantclient.prl
25/01/2007 12.41 865 libqnp.prl
23/01/2007 10.43 16.442.468 libqt-mt.a
23/01/2007 10.03 379.432 libqtmain.a
25/01/2007 12.42 848 libqtmain.prl
23/01/2007 10.46 455.492 libqui.a
25/01/2007 12.42 854 libqui.prl
25/01/2007 12.42 769 qt-mt.prl
23/01/2007 10.44 9.310.208 qt-mt3.dll
16/01/2007 18.06 64 README
15 File 124.924.164 byte
2 Directory 9.861.849.088 byte disponibili
No .lib ! Searching for any .lib files I don't find something similar to yours libs.
What do you think about it?
Stefano
Tim is right, try to use the file 'libqt-mt.a'.
Here is my DIR:
Directory of C:\Qt\3.3.4\lib
04/06/2005 22.01 <DIR> .
04/06/2005 22.01 <DIR> ..
04/06/2005 21.56 8.909.468 designercore.lib
04/06/2005 21.49 838 designercore.prl
04/06/2005 21.56 693.460 editor.lib
04/06/2005 21.49 787 editor.prl
04/06/2005 21.54 53.838 qassistantclient.lib
04/06/2005 21.49 798 qassistantclient.prl
04/06/2005 22.01 585.750 qaxcontainer.lib
04/06/2005 21.49 768 qaxcontainer.prl
04/06/2005 22.01 399.670 qaxserver.lib
04/06/2005 21.49 772 qaxserver.prl
04/06/2005 21.49 796 qnp.prl
04/06/2005 21.49 618 qt-mt.prl
04/06/2005 21.54 4.014.080 qt-mt334.dll
04/06/2005 21.54 3.191.541 qt-mt334.exp
04/06/2005 21.54 5.290.126 qt-mt334.lib
04/06/2005 21.51 5.500 qtmain.lib
04/06/2005 21.49 781 qtmain.prl
04/06/2005 21.55 533.766 qui.lib
04/06/2005 21.50 787 qui.prl
04/06/2005 21.48 76 README
20 File(s) 23.684.220 bytes