You are not logged in.

#1 2007-09-08 18:06:53

lang2
Member
Registered: 2006-02-10
Posts: 386

Failed to compile QT4 examples

Hi there,

I'm having problem compiling a QT4 application. I then tried to compiled the textedit demo shipped with QT4. It doesn't work either:
I did:

QT4DIR=/opt/qt4 /opt/qt4/bin/qmake && make

But the compilation failed because headers couldn't be included:

g++ -c -pipe -mtune=generic -march=i686 -O2 -pipe -Wall -W -D_REENTRANT -DQT_NO_DEBUG -I/opt/qt/mkspecs/linux-g++ -I. -I/opt/qt4//include -I. -I. -o textedit.o textedit.cpp
In file included from textedit.cpp:39:
textedit.h:42:23: error: QMainWindow: No such file or directory
textedit.h:43:16: error: QMap: No such file or directory
textedit.h:44:20: error: QPointer: No such file or directory
In file included from textedit.cpp:40:
printpreview.h:43:20: error: QPrinter: No such file or directory
printpreview.h:44:19: error: QPointF: No such file or directory
printpreview.h:45:18: error: QSizeF: No such file or directory
textedit.cpp:42:19: error: QAction: No such file or directory
textedit.cpp:43:24: error: QApplication: No such file or directory
textedit.cpp:44:22: error: QClipboard: No such file or directory
textedit.cpp:45:24: error: QColorDialog: No such file or directory
textedit.cpp:46:21: error: QComboBox: No such file or directory
textedit.cpp:47:25: error: QFontComboBox: No such file or directory
textedit.cpp:48:17: error: QFile: No such file or directory
textedit.cpp:49:23: error: QFileDialog: No such file or directory
textedit.cpp:50:21: error: QFileInfo: No such file or directory
textedit.cpp:51:25: error: QFontDatabase: No such file or directory
textedit.cpp:52:17: error: QMenu: No such file or directory
textedit.cpp:53:20: error: QMenuBar: No such file or directory
textedit.cpp:54:24: error: QPrintDialog: No such file or directory
textedit.cpp:56:22: error: QTextCodec: No such file or directory
textedit.cpp:57:21: error: QTextEdit: No such file or directory
textedit.cpp:58:20: error: QToolBar: No such file or directory
textedit.cpp:59:23: error: QTextCursor: No such file or directory
textedit.cpp:60:21: error: QTextList: No such file or directory
textedit.cpp:61:19: error: QtDebug: No such file or directory
textedit.cpp:62:23: error: QCloseEvent: No such file or directory
textedit.cpp:63:23: error: QMessageBox: No such file or directory
In file included from textedit.cpp:39:
textedit.h:54: error: expected class-name before '{' token
textedit.h:55: error: ISO C++ forbids declaration of 'Q_OBJECT' with no type
textedit.h:57: error: expected ';' before 'public'
textedit.h:61: error: 'QCloseEvent' has not been declared
textedit.h:67: error: expected ',' or '...' before '&' token
textedit.h:67: error: ISO C++ forbids declaration of 'QString' with no type
textedit.h:69: error: expected ',' or '...' before '&' token
textedit.h:69: error: ISO C++ forbids declaration of 'QString' with no type
textedit.h:71: error: expected `:' before 'slots'
textedit.h:72: error: expected primary-expression before 'void'
textedit.h:72: error: ISO C++ forbids declaration of 'slots' with no type
textedit.h:72: error: expected ';' before 'void'
textedit.h:83: error: expected ',' or '...' before '&' token
textedit.h:83: error: ISO C++ forbids declaration of 'QString' with no type
textedit.h:84: error: expected ',' or '...' before '&' token
textedit.h:84: error: ISO C++ forbids declaration of 'QString' with no type
textedit.h:97: error: expected ',' or '...' before '&' token
textedit.h:97: error: ISO C++ forbids declaration of 'QFont' with no type
textedit.h:98: error: expected ',' or '...' before '&' token
textedit.h:98: error: ISO C++ forbids declaration of 'QColor' with no type
textedit.h:99: error: 'Qt' has not been declared
textedit.h:99: error: expected ',' or '...' before 'a'
textedit.h:120: error: ISO C++ forbids declaration of 'QToolBar' with no type
textedit.h:120: error: expected ';' before '*' token
textedit.h:121: error: 'QString' does not name a type
In file included from textedit.cpp:40:
printpreview.h:51: error: expected class-name before '{' token
printpreview.h:52: error: ISO C++ forbids declaration of 'Q_OBJECT' with no type
printpreview.h:53: error: expected ';' before 'public'
printpreview.h:57: error: 'QSizeF' does not name a type
printpreview.h:58: error: 'QPointF' does not name a type
printpreview.h:60: error: expected `:' before 'slots'
printpreview.h:61: error: expected primary-expression before 'void'
printpreview.h:61: error: ISO C++ forbids declaration of 'slots' with no type
printpreview.h:61: error: expected ';' before 'void'
printpreview.h:69: error: 'QPrinter' does not name a type
textedit.cpp:68: error: 'QString' does not name a type
textedit.cpp:71: error: expected `)' before '*' token
make: *** [textedit.o] Error 1

Did I miss some steps?

thanks

Offline

#2 2007-09-08 18:18:16

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,017

Re: Failed to compile QT4 examples

Try "qt-config qt4".

Offline

#3 2007-09-09 09:26:34

lang2
Member
Registered: 2006-02-10
Posts: 386

Re: Failed to compile QT4 examples

Thanks. I see how this is handled. But how easily can you transfer that into a PKGBUILD? If you want to be compatible with both qt3 and qt4 but you can't re-login in a makepkg session?

Thanks,

Offline

#4 2007-09-09 15:22:39

SlodS
Member
Registered: 2007-03-21
Posts: 20

Re: Failed to compile QT4 examples

Just add

source /etc/profile.d/qt4.sh

somewhere before ./configure smile

Offline

Board footer

Powered by FluxBB