Log in

View Full Version : Qt 3.2 on Windows



xryancat
11th August 2007, 22:00
I recently bought to book C++ GUI Programming With Qt 3 and included with it was a CD-ROM. The CD contained the NonCommercial version of Qt 3 for Windows and the Borland compiler.

Well I installed Borland at F:\Borland\BCC55 and Qt at F:\Qt\3.2.1NonCommercial and the program folder Qt 3.2.1 Non-Commercial. When the installer tries to make the examples I get this error:

Qt is now configured for building. Just run make.
To reconfigure, run make clean and configure.
Could not start make process.
Make sure that your compiler tools are installed
and registered correctly in your PATH environment.

I made a file at F:\Borland\BCC55\bin\bcc32.cfg:

-I"F:\Borland\BCC55\include"
-L"F:\Borland\BCC55\lib"

And F:\Borland\BCC55\bin\ilink32.cfg:

-L"F:\Borland\BCC55\lib"

But I still get that "error".

What exactly am I doing wrong?

Thank you!

marcel
11th August 2007, 22:12
Why are you using borland for?
Do you even need to program in qt3?

I suggest going to TT site and downloading Qt 4.3.1 Open Source. It comes with mingw(gcc) and it is already compiled.

Regards

xryancat
11th August 2007, 22:23
I don't know; it's just what came with the book.

I'm downloading the file you suggested right now. I already have Ubuntu installed on my machine, but I wanted Qt on my Windows install also.

marcel
11th August 2007, 22:27
Well, if you're just starting with Qt and you don't specifically need Qt3 then it is better to use the last version.
It has all the new things.

Regards

xryancat
11th August 2007, 23:48
I got everything installed and I'm now trying to build my first application, this is the code:

#include <qapplication.h>
#include <qlabel.h>

int main( int argc, char *argv[] )
{
QApplication app( argc, argv );
QLabel *label = new QLabel( "Hello QT!", 0 );

label->show();
return app.exec();
}

When I try to run the exe I got the error about needing certain dll's. So I put QtGui4.dll mingwm10.dll and QtCore4.dll in the same directory as the exe, and now I get this error:

The procedure entry point _ZN7QString16fromAscii_helperEPKci could not be located in the dynamic link library QtCore4.dll

Do I need even MORE dependancies for such a simple application?

Thanks for your help, mate! :-)

marcel
11th August 2007, 23:57
No, all you have to do is to set the environment variables.
Go to computer properties, Advanced tab, and press Environment variables.
In user variables add two new vars:
1) QTDIR
This will point to your qt installation ( for example c:\qt\4.3.1 )

2) PATH
Set its value to %QTDIR%\bin;%PATH%.

The cause for your problem could be that you compiled the application with debug info, while those libraries are the release ones.

BTW, what happens if you try to run the Qt examples?

Regards

xryancat
12th August 2007, 00:41
I fixed the things you said; they were previously set to Qt 3.1 settings.

But the application still gives the same error.

I don't think I've changed anything else. QMAKESPEC is still set to win32-borland.

marcel
12th August 2007, 00:44
Yes, you also have to change QMAKESPEC to win32-g++(still an environment variable).

Try uninstalling whatever you installed from that CD that came with the book. Maybe you have some conflicts.

Then rebuild the application.

Regards

xryancat
12th August 2007, 00:48
I changed QMAKESPEC, and I've already uninstalled Qt 3.2, but Borland was still installed. It doesn't have an uninstaller so I physically deleted it's main folder.

I ran qmake and make again, but the error persists.

marcel
12th August 2007, 00:50
OK. can you post the .pro file for your application?

BTW, the basic steps for compiling an application are:
- run qmake -project in the application directory: it will generate the project file
- run qmake again: it will generate the makefiles
- run make. this will compile your application, based on the makefile matching the target set in the pro file

Regards

xryancat
12th August 2007, 00:55
################################################## ####################
# Automatically generated by qmake (2.01a) Sat Aug 11 18:46:56 2007
################################################## ####################

TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .

# Input
SOURCES += hello.cpp

There you go.

marcel
12th August 2007, 00:59
Have you deleted the libraries from the application directory?

Because it is not normal.
It should work.

Regards

xryancat
12th August 2007, 01:01
When I delete them it asks for mingwm10.dll again.

marcel
12th August 2007, 01:08
But I don't think you added the mingw bin directory to your path.

xryancat
12th August 2007, 01:11
What do you mean? My environmental variable PATH is set to %QTDIR%\bin;%PATH%
Like you said.

If that's not what you ment could you please tell me how to change this?

marcel
12th August 2007, 01:27
Assuming that you installed mingw in C:\mingw, then your path var should look like:
%QTDIR%\bin;C:\mingw\bin;%PATH%

xryancat
12th August 2007, 01:34
I changed the PATH variable accordingly. It now reads
%QTDIR%\bin;F:\MinGw\bin;%PATH% (I have my default drive set to F: instead of C:).

But it still says the mingwm10.dll is missing.

marcel
12th August 2007, 01:38
Edit your pro file and add the following:
CONFIG += release qt windows

Then run qmake( for the make files) and rebuild.

Regards

xryancat
12th August 2007, 01:42
The error still comes up. Is it a problem this comes up when I run make?

mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory `F:/Documents and Settings/Admin/My Document
s/hello'
mingw32-make[1]: Nothing to be done for `first'.
mingw32-make[1]: Leaving directory `F:/Documents and Settings/Admin/My Documents
/hello'

marcel
12th August 2007, 01:44
Run a "make clean" and then "make".

But still, it should find the mingwm10.dll. I have no explanation for that.

Regards

xryancat
12th August 2007, 01:48
I ran those commands but nothing has changed. . . Hmm. . . Is there anywhere else you could point me, that may be able to help me? I'm thinking something got messed up when I tried to install Qt 3.2.

marcel
12th August 2007, 01:50
Just make sure there's no trace of Qt3 on your computer.

Try the examples that come with Qt.
See if they run.

Other than that, everything should be OK.

xryancat
12th August 2007, 01:57
You mean the Qt Examples and Demos? When I run them through the main application (Entitled Qt Examples and Demos) they run fine, but when I double click on them I get the same error. Is there a special way to run the files? I've been just double clicking the exe. I used the uninstaller to remove Qt3, and the physical files are gone.

marcel
12th August 2007, 01:58
And make sure you follow the build steps correctly.
BTW, I think in the program group for Qt, in the start menu, you have a Qt command prompt. This sets the environment variables, and it is not prone to errors.

Open that and start from scratch, with the project generation, build, etc.


BTW, when you installed qt 4.3.1, did you choose to let Qt download and install mingw for you.
Are you sure f:\mingw exists?

Regards