Author Topic: QT3 on windows  (Read 11540 times)

stblack

  • Guest
QT3 on windows
« on: January 23, 2007, 08:43:49 am »
I wonder if it's possible to use QT3 instead of QT4 on windows, because in the trolltech website [1] there are only the qt4 available for download.
I would like to test sw both under linux and windows.

Thanks
Stefano

[1] http://www.trolltech.com/developer/downloads/qt

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: QT3 on windows
« Reply #1 on: January 23, 2007, 08:52:43 am »
you might look at http://sourceforge.net/projects/qtwin this is a port of qt3 to windows.
Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

stblack

  • Guest
Re: QT3 on windows
« Reply #2 on: January 23, 2007, 10:01:15 am »
Thanks.  :P
I am installing them now.

Stefano

stblack

  • Guest
Re: QT3 on windows
« Reply #3 on: January 23, 2007, 01:47:36 pm »
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 :
Code
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: QT3 on windows
« Reply #4 on: January 23, 2007, 02:35:22 pm »
Find out why the two headers qapplication.h qpushbutton.h are not being included.

If you did not know QApplication and QPushButton are NOT declared. You need to find out if qtfree supports them and which header is needed. (qpushbutton.h for QPushButton)

It is helpful to turn on Compiler logging to Full command line.
"Settings" -> "Compiler and debugger" Tab "Other" Set "Compiler logging" to "Full command line"

Tim S
« Last Edit: January 23, 2007, 02:45:40 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

stblack

  • Guest
Re: QT3 on windows
« Reply #5 on: January 23, 2007, 04:47:38 pm »
Thanks but I believe the problem it's in the environment variables but I don't understand where.
The qapplication and qpushbutton are in installqt3/include, and this directory is in the PATH as per my previous message.

Stefano

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: QT3 on windows
« Reply #6 on: January 23, 2007, 05:30:30 pm »
Thanks but I believe the problem it's in the environment variables but I don't understand where.
The qapplication and qpushbutton are in installqt3/include, and this directory is in the PATH as per my previous message.

Stefano

The fact that it is in the PATH means nothing to the compiler. You have to explicitely add to the compiler search dirs.
Be patient!
This bug will be fixed soon...

stblack

  • Guest
Re: QT3 on windows
« Reply #7 on: January 24, 2007, 08:51:45 am »
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.

Code
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.
Code
**
** 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

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: QT3 on windows
« Reply #8 on: January 24, 2007, 09:20:42 am »
Your compiler search dirs are fine now. It compiles but it doesn't link. This means that you forgot to link to all needed libraries. I can't tell you which exactly are those because I don't use Qt...
Be patient!
This bug will be fixed soon...

stblack

  • Guest
Re: QT3 on windows
« Reply #9 on: January 24, 2007, 07:49:46 pm »
Thanks.  :(
I will try again to solve this problem and maybe at the end, if with success, I will post the solution to update the website of qtwin[1] : no C::B !!!!
Am I alone to use QT3 under windows?

Thanks
Stefano

[1] http://qtwin.sourceforge.net/qt3-win32/index.php

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: QT3 on windows
« Reply #10 on: January 25, 2007, 01:49:42 am »
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):
Code
[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
« Last Edit: January 25, 2007, 01:54:26 am by iw2nhl »

stblack

  • Guest
Re: QT3 on windows
« Reply #11 on: January 25, 2007, 02:02:41 pm »
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 :
Code
"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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: QT3 on windows
« Reply #12 on: January 25, 2007, 02:13:21 pm »
You are using GCC he was using MSVC.
The normal library naming is different.
GCC is in the form libxyz.a
MSVC is in the form xyz.lib
Where the library name is xyz

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline iw2nhl

  • Multiple posting newcomer
  • *
  • Posts: 116
  • BASIC, C, C++, Qt, bash
Re: QT3 on windows
« Reply #13 on: January 27, 2007, 12:38:11 pm »
Tim is right, try to use the file 'libqt-mt.a'.

Here is my DIR:
Code
 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