You are not logged in.

#1 2008-01-03 18:25:08

Shaika-Dzari
Member
From: Québec, Canada
Registered: 2006-04-14
Posts: 436
Website

[Qt 4][Testing] Helloworld build errors [solved]

Hello!

I tried to build a simple qt 4 hello world and it did not work.

I took trolltech example, used qmake -project, qmake and make.

I got this errors:

shaika-dzari:$ make
g++ -c -pipe -march=i686 -mtune=generic -O2 -pipe -Wall -W -D_REENTRANT -DQT_NO_DEBUG -I/opt/qt/mkspecs/linux-g++ -I. -I/opt/qt/include -I. -I. -I. -o main.o main.cpp
main.cpp:37:25: erreur: QApplication : Aucun fichier ou répertoire de ce type
main.cpp:38:24: erreur: QPushButton : Aucun fichier ou répertoire de ce type
main.cpp:49:3: attention : pas de retour chariot à la fin du fichier
main.cpp: In function 'int main(int, char**)':
main.cpp:42: erreur: 'QApplication' was not declared in this scope
main.cpp:42: erreur: expected `;' before 'app'
main.cpp:44: erreur: 'QPushButton' was not declared in this scope
main.cpp:44: erreur: expected `;' before 'hello'
main.cpp:45: erreur: 'hello' was not declared in this scope
main.cpp:48: erreur: 'app' was not declared in this scope
main.cpp: At global scope:
main.cpp:40: attention : unused parameter 'argc'
main.cpp:40: attention : unused parameter 'argv'
make: *** [main.o] Erreur 1

Make seem to use /opt/qt/mkspecs/ but I think it should use /usr/share/qt/mkspecs for qt 4 ( I use qt 4 package from testing ).
If I unset $QTDIR, qmake seem to load it again.

I found in /usr/share/qt/mkspecs/linux-g++/qmake.conf this line:

...
load(qt_config)

I have 2 qtconfig on my system and both are in my path:

shaika-dzari:$ whereis qtconfig          
qtconfig: /usr/bin/qtconfig /opt/qt/bin/qtconfig
shaika-dzari:$ echo $PATH
/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/opt/bin:/opt/java/bin:/opt/java/jre/bin:/opt/kde/bin:/opt/mozilla/bin:/usr/share/netbeans/bin/:/opt/qt/bin:/usr/local/bin:/opt/openoffice2/program:/opt/realplayer:/opt/skype:/usr/local/bin:/opt/openoffice2/program:/opt/realplayer:/opt/skype:/opt/qt/bin

My qt package:

local/qt 4.3.3-2
    The QT gui toolkit.
local/qt-enhanced 3.3.8-15 (kdemod)
    The Qt GUI toolkit (KDEmod)

I want to be sure before making a bug report. Is it because i use qt-enhanced from kdemod?
When i used qt4 package from community, I did not have any problem.

Any suggestions?

Thank you.

Last edited by Shaika-Dzari (2008-01-04 23:11:26)

Offline

#2 2008-01-03 23:56:06

Shaika-Dzari
Member
From: Québec, Canada
Registered: 2006-04-14
Posts: 436
Website

Re: [Qt 4][Testing] Helloworld build errors [solved]

Up!

Sorry to double post...

I tried to build monkeystudio ( Qt4 ide ) and it did not work too.

I looked in /etc/profile.d and I found qt.sh:

shaika-dzari:$ cat /etc/profile.d/qt.sh
export QTDIR=/opt/qt
export QT_XFT=true
export QMAKESPEC=$QTDIR/mkspecs/linux-g++
export PATH=$PATH:$QTDIR/bin
export MANPATH=$MANPATH:$QTDIR/man
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt/lib/pkgconfig

This is wrong for qt4...
I wrote this script and execute it with my user.
After that, I was able to build my example:

export QTDIR=/usr
export QMAKESPEC=$QTDIR/share/qt/mkspecs/linux-g++
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt4/lib/pkgconfig

Any explaination? smile

@+

Offline

#3 2008-01-04 19:16:10

Shaika-Dzari
Member
From: Québec, Canada
Registered: 2006-04-14
Posts: 436
Website

Re: [Qt 4][Testing] Helloworld build errors [solved]

Ok, maybe this is not the right place to post it so I made a bug report smile :
http://bugs.archlinux.org/task/9092

@+

Edit: problem solve if you remove qt-enhanced and install qt3 package from testing.

Last edited by Shaika-Dzari (2008-01-04 23:11:06)

Offline

Board footer

Powered by FluxBB