View previous topic :: View next topic |
Author |
Message |
Roguelazer Veteran
Joined: 10 Feb 2003 Posts: 1233 Location: San Francisco, CA
|
Posted: Thu Mar 13, 2003 10:47 pm Post subject: Can't compile any of my own Qt Programs |
|
|
Hmmm.... I don't know if this belongs here or not, but I'm gonna try. Anyway, I compiled KDE and Qt and all of that, and was all set to continue my programming with Qt. As a test, I made a simple hello world file and called it qtbutton.cpp. It's this one below:
Code: |
#include <qapplication.h>
#include <qpushbutton.h>
int main (int argc, char **argv)
{
QApplication a(argc,argv);
QPushButton hello("Hello World!", 0);
hello.resize(100,30);
a.setMainWidget(&hello);
hello.show();
return a.exec();
}
|
I then executed the following commands:
Code: |
qmake -project
qmake
make
|
Now, I expected a quick compile and verification of emerge's Qt compile, which is not an unreasonable expectation considering that I was able to compile KDE. However, executing make from any user returns the following code:
Code: | g++ -c -pipe -W -O2 -DQT_NO_DEBUG -I. -I/usr/qt/3/include/ -I/usr/qt/3/mkspecs/linux-g++/ -o qtbutton.o qtbutton.cpp
qtbutton.cpp: In function `int main(int, char**)':
qtbutton.cpp:4: `QApplication' undeclared (first use this function)
qtbutton.cpp:4: (Each undeclared identifier is reported only once for each
function it appears in.)
qtbutton.cpp:4: parse error before `(' token
qtbutton.cpp:6: `QPushButton' undeclared (first use this function)
qtbutton.cpp:7: `quit' undeclared (first use this function)
qtbutton.cpp:8: `QFont' undeclared (first use this function)
qtbutton.cpp:8: parse error before `::' token
qtbutton.cpp:10: `QObject' undeclared (first use this function)
qtbutton.cpp:12: `a' undeclared (first use this function)
qtbutton.cpp:15:2: warning: no newline at end of file
make: *** [qtbutton.o] Error 1
|
Seeing "QApplication undeclared" scares me. The include file seems to be not working, and I think it might be a gentoo problem (as opposed to a Qt problem). Anybody got any thoughts? |
|
Back to top |
|
|
Roguelazer Veteran
Joined: 10 Feb 2003 Posts: 1233 Location: San Francisco, CA
|
Posted: Fri Mar 14, 2003 12:13 pm Post subject: |
|
|
Uh.... Anyone? |
|
Back to top |
|
|
TwoSlick Tux's lil' helper
Joined: 22 Apr 2002 Posts: 114 Location: Rolla, MO
|
Posted: Sun Mar 16, 2003 4:33 am Post subject: |
|
|
One weird thing I came across is compiling programs in a directory named "qt". It doesn't like that at all.
BTW.. Your program compiled fine for me.
Let me know if the directory tip helps ya.
- TwoSlick |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|