Development with QT 4.3 under Ubuntu 7.10 x86

James Takac p3nndrag0n at gmail.com
Fri Aug 29 01:30:36 UTC 2008


Hi Ioannis

On Friday 29 August 2008 00:50:30 Ioannis Vranos wrote:
> James Takac wrote:
> > Hi Ioannis
> >
> > On Friday 29 August 2008 00:26:03 Ioannis Vranos wrote:
> >> 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$
> >
> > It seems like Anjuta isn't finding your header files. I seem to have
> > better luck using kedevelop from the repositories for qt4 programs
>
> I suppose you mean KDevelop. Which are the repositories you are talking
> about?
>
>
> Thanks,
>
> Ioannis


yep. my bad with the typo there. I've found Anjuta sometimes doesn't allow the 
paths to libraries or header files to be input making some projects difficult 
to say the least whilst kdevelop makes allowances via the projects properties

James




More information about the ubuntu-users mailing list