Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't compile any of my own Qt Programs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Roguelazer
Veteran
Veteran


Joined: 10 Feb 2003
Posts: 1233
Location: San Francisco, CA

PostPosted: Thu Mar 13, 2003 10:47 pm    Post subject: Can't compile any of my own Qt Programs Reply with quote

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
View user's profile Send private message
Roguelazer
Veteran
Veteran


Joined: 10 Feb 2003
Posts: 1233
Location: San Francisco, CA

PostPosted: Fri Mar 14, 2003 12:13 pm    Post subject: Reply with quote

Uh.... Anyone?
Back to top
View user's profile Send private message
TwoSlick
Tux's lil' helper
Tux's lil' helper


Joined: 22 Apr 2002
Posts: 114
Location: Rolla, MO

PostPosted: Sun Mar 16, 2003 4:33 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
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