I've been trying to get qt (there seems to be both qt3 and qt4) to work properly in Ubuntu 10.4. First I installed qt with just the libraries, which I installed through the command line, then I tried removing those and installing the entire qt development environment through the ubuntu software center (though I really don't need the whole thing, I really prefer to program through the command line), but nothing seems to make any difference. Here's the problem I'm having. qmake works completely fine, but when I try the make command on a simple qt program I get:
g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/linux-g++ -I. -I. -I/usr/include/qt3 -o main.o main.cpp
main.
cpp:1:25: error
: QApplication: No such
file or directory
main.
cpp:2:24: error
: QPushButton: No such
file or directory
g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/linux-g++ -I. -I. -I/usr/include/qt3 -o main.o main.cpp
main.cpp:1:25: error: QApplication: No such file or directory
main.cpp:2:24: error: QPushButton: No such file or directory
To copy to clipboard, switch view to plain text mode
And then of course a bunch of other errors as a result of those. The basic script I'm using is as follows:
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
hello.resize(100, 30);
hello.show();
return app.exec();
}
#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();
}
To copy to clipboard, switch view to plain text mode
It seems that it can't find the qt libraries, but the paths in the Makefile are correct, as far as I can tell - though they point to qt3 and not qt4 for some reason.
LIBS = $(SUBLIBS) -L/usr/share/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm -lpthread
LIBS = $(SUBLIBS) -L/usr/share/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm -lpthread
To copy to clipboard, switch view to plain text mode
What am I doing wrong?
Bookmarks