PDA

View Full Version : Loaded QT 4.1.1 and MinGW Compiler



Seth
8th July 2006, 04:38
Totally green and stuck

Loaded QT 4.1.1 and MinGW Compiler from the new book "C++ GUI Programming with QT 4". The QT and MinGW installation went smoothly.

Opened up the QT 4.1.1 Command Prompt (which comes with the QT installation) which automatically sets the enviromental variables, (see attachment)

In my attemp to run the good old Hello QT program from the book. I used the books Hello QT code then I ran the qmake -project, qmake hello.cpp, and make, and that went smoothly.

Then I tried to run the program by typing hello into the command line and I get the following'hello' is not recognized as an internal or external command, operable program or batch file"

Could it be automatic enviromental variable settings?

Anybody have any ideas?

Thanks in advance!

munna
8th July 2006, 05:42
Is your current folder same as where hello.exe is?

Brandybuck
8th July 2006, 06:08
Either the program location has to be in your path, or you need to run it from its location, or you need to double click on its executable from the file manager. In that regard it's no different from any other program.

Seth
8th July 2006, 07:05
Okay, attached is my current folder structure.


Is your current folder same as where hello.exe is?

Here is a green question. I am not seeing the executable that should have been generated.

Should I be seeing an hello.exe in my hello folder? How is the .exe generated?

munna
8th July 2006, 07:23
It will either be in your debug or release folder. Just double click the exe:)

Seth
8th July 2006, 14:24
Munna,

It will either be in your debug or release folder. Just double click the exe:)

Thanks! A double click and Hello QT dialog box popped up.

I thought from the command line I could run the program? That's how its described in the new QT book instead I got 'hello' is not recognized as... . Any thoughts?


Anyway, thanks for the help! :)

munna
8th July 2006, 14:59
You can do that by 2 ways

1. Go to the folder where the exe is i.e., cd debug (in the command prompt) and then hello.
2. In your .pro file change the settings so that the exe is created in the current folder itself and not in the debug or release folder.

I would suggest you the first option.

fullmetalcoder
8th July 2006, 15:03
I thought from the command line I could run the program? That's how its described in the new QT book instead I got 'hello' is not recognized as... . Any thoughts?


"hello" is not recognized as an executable because the command line current directory isn't the same as the directory in which your program is located... There are two ways to run your program from command line :


cd release
hello

or :


release\hello


BTW QT means Quick Time... I suppose you're referring to Qt... ;)