LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   QT 4 include files produce compiler errors in wrappers on C (https://www.linuxquestions.org/questions/linux-general-1/qt-4-include-files-produce-compiler-errors-in-wrappers-on-c-595414/)

YuriyRusinov 10-29-2007 04:38 AM

QT 4 include files produce compiler errors in wrappers on C
 
Hello !

I develop wrappers in C for C++ library, which was make with QT class library. Which way I have to include header files from QT into my .c file
e.g.
Code:

search.c

#include <QObject>

If I try to make project using qmake utility and in pro file write
Code:

QT += core
then I receive many error messages such this
Quote:

gcc -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/opt/xgis/include/xgis -I/opt/gdal/include -I. -I. -o search.o search.c
In file included from /usr/include/qt4/QtCore/qobjectdefs.h:42,
from /usr/include/qt4/QtCore/qobject.h:44,
from /usr/include/qt4/QtCore/QObject:1,
from /opt/xgis/include/xgis/searchengine.h:9,
from search.c:1:
/usr/include/qt4/QtCore/qnamespace.h:46: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QT_MODULE’
/usr/include/qt4/QtCore/qnamespace.h:1424: error: expected ‘)’ before ‘:’ token
/usr/include/qt4/QtCore/qnamespace.h:1440: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Q_CORE_EXPORT’
Thanks in advance,
Yuriy Rusinov.


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