PDA

View Full Version : correctly installed Qt4


Salazaar
1st May 2007, 23:03
Hi, I've got a huge request. Can somebody upload for me Dev-C++ with correctly installed Qt 4? I would be very very thankful.

high_flyer
2nd May 2007, 13:18
What do you mean with Qt4 correctly installed?
Dev-C++ is just an IDE.
It has no connection with Qt4.
You can develop Qt4 apps with Dev-C++, but no one can "upload" it, since these are two seperate things.

marcel
2nd May 2007, 18:15
Perhaps you need guidance on how to set it up in order to use it with Qt?

Osoascam
2nd May 2007, 19:38
My first post!!! Yay!!! :D

Hi!!
I'm new (completely new) at C++. I'm trying to use QT for a homework. I can ONLY use QT or GTK, and I think QT is a lot simpler. I got only two weeks for this project, so there's no time I can waste. :p

The thing is... How do I install QT? :confused:

I followed all of the steps in this page: http://darkhack.googlepages.com/qttutorial

It didn't work. At all, so I entered this page: http://nicolasj.developpez.com/articles/qt4/ (http://nicolasj.developpez.com/articles/qt4/)
This site is in french... Yeap, I had a hard time

There, it explained some things a bit (the "qmake" directory was wrong, so I got a hard time finding it). Qmake is supposed to create a Makefile.Release, and then you use some variables of it to make a Template.

The thing is, after all this trouble (that costed me one whole day of nothingness), I still caaaaan't!!!! :'(

There's an error that says (using Dev-c++, by the way)
[main.o] Error 1

WHat can I do?

If somebody has an easy way of using QT, please help me, I'm starting to feel a bit desperate...

Thanks!!!

If I have to restar from zero, it doesn't matter. But I have only two weeks for learning C++, B-Trees and Qt... And time is gold... Could you please help me? :crying:

(And that way, you can also help [B]Salazaar)

Salazaar
2nd May 2007, 19:59
Yeah, I also have done everything what is described in http://darkhack.googlepages.com/qttutorial but it doesn't work, i tried many installation tips, but is still doesn't work!! I'd like to make applications in Qt, but i can't install that. So could somebody tell me, where's 100% correct installing tutorial? Thanks

marcel
2nd May 2007, 20:59
You must first compile Qt in order to use it with Dev-C++.
The open source version is just that: open source :). No binaries. They have to be compiled.

What compilers are you using? Mingw or the Microsoft C++ compiler (Visual C++ )?

This influences the building process...

Regards

Salazaar
2nd May 2007, 22:07
I'm using Dev-C++ (which is using MinGW). And I'd really like to desing qt applications, but I can't install it! All of the tutorial tries are failed... Do you now any 100% checked way to install Qt4? I have Qt4 opensource installer on my desktop, Thanks

Osoascam
3rd May 2007, 05:27
Hahahaha!! Yeah!! All tutorials have failed (or maybe WE have failed). As I said before, I also used the french page (which I translated to English with Google). Well, Salazaar, at least we're not alone. There's a whole crew of classmates of mine which have the same problem.

Some have already given up and started using GTK (which, to me, seems a lot more complicated to use). As soon as somebody has an answer, I will post it.

By the way, I know nothing of C++, so that main.o thing mekase me go "WTF????" :confused: :confused: :confused:

Osoascam
3rd May 2007, 05:28
By the way... I used that qmake thing... I suppose that compiles, doesn't it? This demonstrates my level of "lostiness"... :o

vermarajeev
3rd May 2007, 05:57
By the way... I used that qmake thing... I suppose that compiles, doesn't it? This demonstrates my level of "lostiness"... :o

Did you try this linkhttp://www.imb-jena.de/~hollund/software.html
See the section Qt4 with Dev-C++
I'm using Kdevelop on linux system and there is no problem.

Brandybuck
3rd May 2007, 06:26
I don't understand what all this confusion is about. For Windows, I download Qt open source, and run the installer program. When it asks me if I want MinGW, I say yes. But if you already have MinGW with Dev-C++, then say no, and give it the right location. Soon Qt is installed and working. Very easy.

If you are having troubles, then you need to say more than just "it doesn't work." Tell us WHAT doesn't work. Tell us the error messages. Tell us exactly what you are doing.

Salazaar
3rd May 2007, 20:23
Ok, so I have:
1) Downloaded Qt 4.2.3 Open Source installer
2) Installed it to my Dev-C++ directory
3) Added this (http://darkhack.googlepages.com/Qt4.1-Template.zip) template to my Dev-Cpp/Temaplates
4) Added C:/Qt/4.2.3/lib library and C:/Qt/4.2.3/bin binary file to Dev-C++ by tools->compilator options->directories
The warnings are such as:
1 C:\Dev-Cpp\main.cpp QApplication: No such file or directory.
2 C:\Dev-Cpp\main.cpp QPushButton: No such file or directory.
6 C:\Dev-Cpp\main.cpp `QApplication' undeclared (first use this function)
6 C:\Dev-Cpp\main.cpp expected `;' before "app"
And more. Code, which I have used:
#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QPushButton hello("Hello world!");
hello.resize(100, 30);

hello.show();
return app.exec();
}

marcel
3rd May 2007, 20:34
What about the include paths? Have you set them correctly?

They should be ( or contain ) C:/Qt/4.2.3/include

Regards

Salazaar
3rd May 2007, 20:44
They're in c:/Qt/4.2.3/include but how could I set them to Dev?

marcel
3rd May 2007, 21:02
Create a new project and look in the project options.

I never used it, but any decent IDE should have an option for additional include paths.

Regards

Salazaar
3rd May 2007, 21:11
I have added this to Project options->directiories but it still doesn't work. The same errors. What I am doing wrong?

marcel
3rd May 2007, 21:37
Try adding the to Tools/Compiler options/Directories/C++ includes also.

Maybe it works this way.
Somehow it's gotta work... :)

Salazaar
3rd May 2007, 22:01
No, It still doesn't work. (To one of users: Now you see, what is this confusion about). So what do I have to do to set all of this .... correctly? Regards

marcel
3rd May 2007, 22:17
I used your template and I made it work. But this is an unacceptable solution. You have to add all the directory paths inside c:\qt\include in the project options.

Regards

Salazaar
3rd May 2007, 22:20
It means that I have to add every file which is in include directory manually? Do I have to do the same with bin and lib directories?

marcel
3rd May 2007, 22:23
No, not every file, but every directory. I added them to project options and also to the tools menu compiler options.

I didn't set anything for the bin dir, only for the lib dire, in the project options.

Salazaar
3rd May 2007, 22:27
for the lib or include directory? And did it work without bin?

Salazaar
3rd May 2007, 22:44
Ok, you were right, but now are errors such as:

334 C:\Qt\4.2.3\include\QtGui\qapplication.h `QT_END_HEADER' does not name a type
/Qt/4.2.3/include/QtGui/qpushbutton.h C:\Dev-Cpp\C QtGui/qabstractbutton.h: No such file or directory.

And so on and so on. What's incorrect now?:eek:
Thanks
Regards

Salazaar
4th May 2007, 09:47
it may be problem with the qt directory, but I have official qt installer!

marcel
4th May 2007, 10:17
No it's more likely a problem with the configuration and/or devcpp.
I tried compiling a more complex app and it didn't work.

Perhaps there is someone who uses it on a regular basis and could give you some more pointers.

Also, there is a dev-cpp forum on sourceforge.net. It is accessible from the devcpp site. Maybe you could ask some questions there.

Regards

Salazaar
4th May 2007, 19:13
OK, thanks. what ide are you using to write applications using qt on windows? and could you tell me how to set qt with it? regards

marcel
4th May 2007, 19:44
I am using Visual Studio 2003 with Qt Commercial, but only when I'm at work ( most of the time :) ), so there aren't many settings I have to make, Qt VS Integration takes care of them.

If you're using Qt Open Source then why don't you try Edyuk at http://sourceforge.net/projects/edyuk. I believe fullmetalcoder could give you more details about it ( what it supports and what it doesn't ) because he made it.

Regards

Salazaar
5th May 2007, 11:22
"It is primarily meant to support C++ language in association with Qt4 framework"
So it should work perfectly

Salazaar
5th May 2007, 11:40
Ok, I have downloaded Edyuk, but in this file theres no any install.exe-like files, just like Doxyfile, Edyuk (without any expansion like .exe etc.) And in readme there's nothing about installing... So do you know how can I do it?

Brandybuck
5th May 2007, 20:48
Instead of writing:

#include <QApplication>

write:

#include <QtGui/QApplication>

Then you don't have to enter every subdirectory in your include path.

Osoascam
7th May 2007, 00:11
[Build Error] [main.o] Error 1

Still getting that error!!
All I tried to do was this:

#include <QApplication>
#include <QPushButton>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QPushButton hello("Hello world!");
hello.resize(100, 30);

hello.show();
return app.exec();
}

Thanks in Advance... :crying: :crying: :crying: :confused:

Salazaar
7th May 2007, 08:24
Hi. I can't configure it with dev, but I already know what to do to compile and build Qt api's (thanks to Marcel ;-)). You have to add 3 environment variables to users variables in start->control panel->system->advanced->environment variables and you add QTDIR with location of your Qt installation (now I'm in school, so I don't remember these 2 left, but I will add them in home) and you create files like in normal project (in dev) but you don't compile it, but you do what's described in Qt Assistant->Qmake->(getting started or something like that)
(Once more-thanks to Marcel ;))