LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   QT on suse9.3 compile error, fresh installation (https://www.linuxquestions.org/questions/programming-9/qt-on-suse9-3-compile-error-fresh-installation-465953/)

TTux 07-20-2006 12:42 PM

QT on suse9.3 compile error, fresh installation
 
Hello all,

I have freshly installed SuSE 9.3, with QT developmental files and tools. Its a very fresh installation, and I installed it only because I had to develop for this specific version of QT which comes as default with SuSE 9.3.

Now the problem is when I try to compile even the "hello world" code given in QT documentation (tutorial# 1, example 1 - hello world), it gives huge amounts of compile errors!
I followed the standard method of qmake -project, qmake, make. Below are the initial few lines of compiler errors after running make (I captured these by running make 2>&1 | less):


gcc -c -pipe -O2 -march=i586 -mcpu=i686 -fmessage-length=0 -Wall -g -Wall -W -O2
-march=i586 -mcpu=i686 -fmessage-length=0 -Wall -g -DQT_NO_DEBUG -DQT_SHARED -
DQT_TABLET_SUPPORT -DQT_THREAD_SUPPORT -I/usr/lib/qt3/mkspecs/default -I. -I. -I
/usr/include -I/usr/lib/qt3/include -o hello.o hello.c
In file included from /usr/lib/qt3/include/qwindowdefs.h:43,
from /usr/lib/qt3/include/qwidget.h:42,
from /usr/lib/qt3/include/qdesktopwidget.h:40,
from /usr/lib/qt3/include/qapplication.h:42,
from hello.c:1:
/usr/lib/qt3/include/qobjectdefs.h:152: error: syntax error before "QObject"
/usr/lib/qt3/include/qobjectdefs.h:152: warning: type defaults to `int' in decla
ration of `QObject'
/usr/lib/qt3/include/qobjectdefs.h:152: warning: data definition has no type or
storage class
/usr/lib/qt3/include/qobjectdefs.h:153: error: syntax error before "QMetaObject"
/usr/lib/qt3/include/qobjectdefs.h:153: warning: type defaults to `int' in decla
ration of `QMetaObject'
/usr/lib/qt3/include/qobjectdefs.h:153: warning: data definition has no type or
storage class
/usr/lib/qt3/include/qobjectdefs.h:154: error: syntax error before "QSignal"
/usr/lib/qt3/include/qobjectdefs.h:154: warning: type defaults to `int' in decla
ration of `QSignal'
.....
.....

The total lines of errors printed were like almost 3500!!!

I'm clueless about what's wrong... is it not able to find some header file or something?
I'm clearly missing something basic here, because same I tried on SuSE 10 as well as SuSE 10.1, and same result, same errors...

Please help...

Thanks and best regards,
TTux

TTux 07-20-2006 01:23 PM

Okay I got the solution. I edited the qmake.conf file (/usr/lib/qt3/mkspecs/linux-g++/qmake.conf). Changed the following line:

Old:
QMAKE_CC = gcc
New:
QMAKE_CC = g++


This did the trick. :-)


All times are GMT -5. The time now is 02:04 PM.