Development with QT 4.3 under Ubuntu 7.10 x86

Ioannis Vranos ivranos at freemail.gr
Thu Aug 28 14:26:03 UTC 2008


OS: Ubuntu 7.10 x86.


Hi, I am trying to learn QT 4.3 development, and although I have
installed the corresponding QT packages, the C++ QT 4.3 specific source
code does not compile under Anjuta and of course the command line.

No QT3 packages are installed, and all QT4 packages have been reinstalled.


I have also tried adding in .profile the lines

PATH=/usr/share/qt4/bin:$PATH
export PATH

and it didn't help.



Any ideas?


The QT4 hello world program I am trying 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();
}



john at john-desktop:~/Projects/foobar-cpp/src$ g++ main.cc -o main
main.cc:1:24: error: QApplication: No such file or directory
main.cc:2:18: error: QLabel: No such file or directory
main.cc: In function ‘int main(int, char**)’:
main.cc:6: error: ‘QApplication’ was not declared in this scope
main.cc:6: error: expected `;' before ‘app’
main.cc:8: error: ‘QLabel’ was not declared in this scope
main.cc:8: error: ‘label’ was not declared in this scope
main.cc:8: error: expected type-specifier before ‘QLabel’
main.cc:8: error: expected `;' before ‘QLabel’
main.cc:12: error: ‘app’ was not declared in this scope
john at john-desktop:~/Projects/foobar-cpp/src$





More information about the ubuntu-users mailing list