You are not logged in.

#1 2009-03-07 00:41:41

grimrider
Member
From: Ohio
Registered: 2008-12-09
Posts: 60

qt4 headers???

all im trying to do is get this to compile:

#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QLabel *label = new QLabel("Hello Qt!");
    label->show();
    return app.exec();
}

and here is the errors i get:

/home/nick/Projects/test1/main.cpp|1|error: QApplication: No such file or directory|
/home/nick/Projects/test1/main.cpp|2|error: QLabel: No such file or directory|
/home/nick/Projects/test1/main.cpp||In function 'int main(int, char**)':|
/home/nick/Projects/test1/main.cpp|5|error: 'QApplication' was not declared in this scope|
/home/nick/Projects/test1/main.cpp|5|error: expected `;' before 'app'|
/home/nick/Projects/test1/main.cpp|6|error: 'QLabel' was not declared in this scope|
/home/nick/Projects/test1/main.cpp|6|error: 'label' was not declared in this scope|
/home/nick/Projects/test1/main.cpp|6|error: expected type-specifier before 'QLabel'|
/home/nick/Projects/test1/main.cpp|6|error: expected `;' before 'QLabel'|
/home/nick/Projects/test1/main.cpp|8|error: 'app' was not declared in this scope|
||=== Build finished: 9 errors, 0 warnings ===|

im assuming its because i dont have the qt4 headers installed but i could be wrong.  how do i install them?

Offline

#2 2009-03-07 01:05:10

Killa B
Member
From: United States
Registered: 2008-10-28
Posts: 42
Website

Re: qt4 headers???

grimrider wrote:

im assuming its because i dont have the qt4 headers installed but i could be wrong.  how do i install them?

Did you try

pacman -S qt

Offline

#3 2009-03-07 01:10:24

grimrider
Member
From: Ohio
Registered: 2008-12-09
Posts: 60

Re: qt4 headers???

Killa B wrote:

Did you try

pacman -S qt

yeah,

bash-3.2# pacman -S qt
warning: qt-4.4.3-5 is up to date -- reinstalling
resolving dependencies...
looking for inter-conflicts...

Targets (1): qt-4.4.3-5

Total Download Size:    17.85 MB
Total Installed Size:   57.29 MB

Proceed with installation? [Y/n]

maybe im just setting it up wrong.  is there a special way you have to do it w/ codeblocks?

Last edited by grimrider (2009-03-07 01:11:01)

Offline

#4 2009-03-07 03:27:09

Killa B
Member
From: United States
Registered: 2008-10-28
Posts: 42
Website

Re: qt4 headers???

Okay, I googled it for you.

In the same directory as your source code run:

qmake -project; qmake; make

Presto, chango, magico! It works!

Offline

#5 2009-03-08 01:08:53

grimrider
Member
From: Ohio
Registered: 2008-12-09
Posts: 60

Re: qt4 headers???

yeah, i knew how to do it that way.  i guess i should have been more specific.  what exactly do i have to do to get it to compile in Code::Blocks?

Offline

#6 2009-03-09 22:58:27

gnud
Member
Registered: 2005-11-27
Posts: 182

Re: qt4 headers???

Have a look at QtWorkbench -- http://code.google.com/p/qtworkbench/

Offline

Board footer

Powered by FluxBB