Hello List,<br><br>I am wondering if someone can help me get the C++ tutorials to compile using Eclipse?  <br><br>Here is my set up:<br>- Ubuntu 9.04<br>- QGIS version 1.0.2 standard install from the repositories<br>- QGIS version 1.2.0 compiled and installed to /usr/local<br>
- Eclipse Ganymede with CDT and Qt Integration<br><br>So what I have done is:<br>1) Create a new Qt GUI Project, GUI Type: QMainWindow (this compiles and runs but doesn&#39;t do anything)<br>2) Add /usr/include/qgis to the project includes<br>
3) Add the following to the .pro file:<br>        INCLUDEPATH += /usr/include/qgis<br>       QT += core gui sql xml svg opengl qt3support<br>4) Copy and paste the tutorial code from <a href="http://blog.qgis.org/node/10">http://blog.qgis.org/node/10 </a>to the automatically generated main.cpp file.<br>
<br>I have also tried to reference the QGIS version 1.2.0 that was compiled locally, but no luck.<br><br>When I try to compile the project it looks like the QGIS classes are not recognized and I get the errors below.  It looks like it is finding the *.h files.  I suspect that it is a problem with my *.pro file.<br>
<br>If someone could help me out it would be greatly appreciated, even just a point in the right direction.<br><br><br>----ERRORS-------------<br>make debug <br>make -f Makefile.Debug<br>make[1]: Entering directory `/home/matt/workspace/QGIS_Test2&#39;<br>
/usr/bin/uic-qt4 qgis_test2.ui -o ui_qgis_test2.h<br>g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_SVG_LIB -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -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/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/qt4/QtSql -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/QtSvg -I/usr/include/qt4 -I/usr/include/qgis -I/usr/X11R6/include -Idebug -I. -o debug/main.o main.cpp<br>
In file included from main.cpp:6:<br>/usr/include/qgis/qgsapplication.h:25: error: function definition does not declare parameters<br>In file included from main.cpp:7:<br>/usr/include/qgis/qgsproviderregistry.h:39: error: function definition does not declare parameters<br>
In file included from /usr/include/qgis/qgsrenderer.h:29,<br>                 from /usr/include/qgis/qgssinglesymbolrenderer.h:22,<br>                 from main.cpp:8:<br>/usr/include/qgis/qgis.h:26: error: function definition does not declare parameters<br>
In file included from /usr/include/qgis/qgssinglesymbolrenderer.h:22,<br>                 from main.cpp:8:<br>/usr/include/qgis/qgsrenderer.h:39: error: function definition does not declare parameters<br>In file included from main.cpp:8:<br>
/usr/include/qgis/qgssinglesymbolrenderer.h:26: error: function definition does not declare parameters<br>/usr/include/qgis/qgssinglesymbolrenderer.h:68: error: ‘QgsSingleSymbolRenderer’ has not been declared<br>/usr/include/qgis/qgssinglesymbolrenderer.h:68: error: non-member function ‘const QgsSymbol* symbol()’ cannot have cv-qualifier<br>
/usr/include/qgis/qgssinglesymbolrenderer.h: In function ‘const QgsSymbol* symbol()’:<br>/usr/include/qgis/qgssinglesymbolrenderer.h:70: error: ‘mSymbol’ was not declared in this scope<br>/usr/include/qgis/qgssinglesymbolrenderer.h: At global scope:<br>
/usr/include/qgis/qgssinglesymbolrenderer.h:73: error: ‘QgsSingleSymbolRenderer’ has not been declared<br>/usr/include/qgis/qgssinglesymbolrenderer.h:73: error: non-member function ‘bool needsAttributes()’ cannot have cv-qualifier<br>
In file included from main.cpp:9:<br>/usr/include/qgis/qgsmaplayerregistry.h:35: error: function definition does not declare parameters<br>In file included from /usr/include/qgis/qgsrectangle.h:26,<br>                 from /usr/include/qgis/qgsmaplayer.h:27,<br>
                 from /usr/include/qgis/qgsvectorlayer.h:28,<br>                 from main.cpp:10:<br>/usr/include/qgis/qgspoint.h:30: error: function definition does not declare parameters<br>/usr/include/qgis/qgspoint.h:138: error: expected ‘,’ or ‘...’ before ‘&amp;’ token<br>
/usr/include/qgis/qgspoint.h:138: error: ISO C++ forbids declaration of ‘QgsPoint’ with no type<br>/usr/include/qgis/qgspoint.h:138: error: ‘bool operator==(int)’ must have an argument of class or enumerated type<br>/usr/include/qgis/qgspoint.h:146: error: expected ‘,’ or ‘...’ before ‘&amp;’ token<br>
/usr/include/qgis/qgspoint.h:146: error: ISO C++ forbids declaration of ‘QgsPoint’ with no type<br>/usr/include/qgis/qgspoint.h: In function ‘std::ostream&amp; operator&lt;&lt;(std::ostream&amp;, int)’:<br>/usr/include/qgis/qgspoint.h:149: error: ‘p’ was not declared in this scope<br>
/usr/include/qgis/qgspoint.h: At global scope:<br>/usr/include/qgis/qgspoint.h:146: warning: unused parameter ‘QgsPoint’<br>In file included from /usr/include/qgis/qgsmaplayer.h:27,<br>                 from /usr/include/qgis/qgsvectorlayer.h:28,<br>
                 from main.cpp:10:<br>/usr/include/qgis/qgsrectangle.h:35: error: function definition does not declare parameters<br>/usr/include/qgis/qgsrectangle.h:134: error: expected initializer before ‘::’ token<br>/usr/include/qgis/qgsrectangle.h:138: error: ‘QgsRectangle’ has not been declared<br>
/usr/include/qgis/qgsrectangle.h: In function ‘void setXMinimum(double)’:<br>/usr/include/qgis/qgsrectangle.h:140: error: ‘xmin’ was not declared in this scope<br>/usr/include/qgis/qgsrectangle.h: At global scope:<br>/usr/include/qgis/qgsrectangle.h:143: error: ‘QgsRectangle’ has not been declared<br>
/usr/include/qgis/qgsrectangle.h: In function ‘void setXMaximum(double)’:<br>/usr/include/qgis/qgsrectangle.h:145: error: ‘xmax’ was not declared in this scope<br>/usr/include/qgis/qgsrectangle.h: At global scope:<br>/usr/include/qgis/qgsrectangle.h:148: error: ‘QgsRectangle’ has not been declared<br>
/usr/include/qgis/qgsrectangle.h: In function ‘void setYMinimum(double)’:<br>/usr/include/qgis/qgsrectangle.h:150: error: ‘ymin’ was not declared in this scope<br>/usr/include/qgis/qgsrectangle.h: At global scope:<br>/usr/include/qgis/qgsrectangle.h:153: error: ‘QgsRectangle’ has not been declared<br>
/usr/include/qgis/qgsrectangle.h: In function ‘void setYMaximum(double)’:<br>/usr/include/qgis/qgsrectangle.h:155: error: ‘ymax’ was not declared in this scope<br>/usr/include/qgis/qgsrectangle.h: At global scope:<br>/usr/include/qgis/qgsrectangle.h:158: error: ‘QgsRectangle’ has not been declared<br>
/usr/include/qgis/qgsrectangle.h:158: error: non-member function ‘double xMaximum()’ cannot have cv-qualifier<br>/usr/include/qgis/qgsrectangle.h: In function ‘double xMaximum()’:<br>/usr/include/qgis/qgsrectangle.h:160: error: ‘xmax’ was not declared in this scope<br>
/usr/include/qgis/qgsrectangle.h: At global scope:<br>/usr/include/qgis/qgsrectangle.h:163: error: ‘QgsRectangle’ has not been declared<br>/usr/include/qgis/qgsrectangle.h:163: error: non-member function ‘double xMinimum()’ cannot have cv-qualifier<br>
/usr/include/qgis/qgsrectangle.h: In function ‘double xMinimum()’:<br>/usr/include/qgis/qgsrectangle.h:165: error: ‘xmin’ was not declared in this scope<br>/usr/include/qgis/qgsrectangle.h: At global scope:<br>/usr/include/qgis/qgsrectangle.h:168: error: ‘QgsRectangle’ has not been declared<br>
/usr/include/qgis/qgsrectangle.h:168: error: non-member function ‘double yMaximum()’ cannot have cv-qualifier<br>/usr/include/qgis/qgsrectangle.h: In function ‘double yMaximum()’:<br>/usr/include/qgis/qgsrectangle.h:170: error: ‘ymax’ was not declared in this scope<br>
/usr/include/qgis/qgsrectangle.h: At global scope:<br>/usr/include/qgis/qgsrectangle.h:173: error: ‘QgsRectangle’ has not been declared<br>/usr/include/qgis/qgsrectangle.h:173: error: non-member function ‘double yMinimum()’ cannot have cv-qualifier<br>
/usr/include/qgis/qgsrectangle.h: In function ‘double yMinimum()’:<br>/usr/include/qgis/qgsrectangle.h:175: error: ‘ymin’ was not declared in this scope<br>/usr/include/qgis/qgsrectangle.h: At global scope:<br>/usr/include/qgis/qgsrectangle.h:178: error: ‘QgsRectangle’ has not been declared<br>
/usr/include/qgis/qgsrectangle.h:178: error: non-member function ‘double width()’ cannot have cv-qualifier<br>/usr/include/qgis/qgsrectangle.h: In function ‘double width()’:<br>/usr/include/qgis/qgsrectangle.h:180: error: ‘xmax’ was not declared in this scope<br>
/usr/include/qgis/qgsrectangle.h:180: error: ‘xmin’ was not declared in this scope<br>/usr/include/qgis/qgsrectangle.h: At global scope:<br>/usr/include/qgis/qgsrectangle.h:183: error: ‘QgsRectangle’ has not been declared<br>
/usr/include/qgis/qgsrectangle.h:183: error: non-member function ‘double height()’ cannot have cv-qualifier<br>/usr/include/qgis/qgsrectangle.h: In function ‘double height()’:<br>/usr/include/qgis/qgsrectangle.h:185: error: ‘ymax’ was not declared in this scope<br>
/usr/include/qgis/qgsrectangle.h:185: error: ‘ymin’ was not declared in this scope<br>/usr/include/qgis/qgsrectangle.h: At global scope:<br>/usr/include/qgis/qgsrectangle.h:188: error: ‘QgsPoint’ does not name a type<br>/usr/include/qgis/qgsrectangle.h:192: error: expected ‘,’ or ‘...’ before ‘&amp;’ token<br>
/usr/include/qgis/qgsrectangle.h:192: error: ISO C++ forbids declaration of ‘QgsRectangle’ with no type<br>/usr/include/qgis/qgsrectangle.h: In function ‘std::ostream&amp; operator&lt;&lt;(std::ostream&amp;, int)’:<br>/usr/include/qgis/qgsrectangle.h:192: error: redefinition of ‘std::ostream&amp; operator&lt;&lt;(std::ostream&amp;, int)’<br>
/usr/include/qgis/qgspoint.h:146: error: ‘std::ostream&amp; operator&lt;&lt;(std::ostream&amp;, int)’ previously defined here<br>/usr/include/qgis/qgsrectangle.h:194: error: ‘r’ was not declared in this scope<br>/usr/include/qgis/qgsrectangle.h: At global scope:<br>
/usr/include/qgis/qgsrectangle.h:192: warning: unused parameter ‘QgsRectangle’<br>In file included from /usr/include/qgis/qgsvectorlayer.h:28,<br>                 from main.cpp:10:<br>/usr/include/qgis/qgsmaplayer.h:41: error: function definition does not declare parameters<br>
In file included from /usr/include/qgis/qgsvectorlayer.h:29,<br>                 from main.cpp:10:<br>/usr/include/qgis/qgsfeature.h:49: error: function definition does not declare parameters<br>In file included from /usr/include/qgis/qgsvectorlayer.h:30,<br>
                 from main.cpp:10:<br>/usr/include/qgis/qgssnapper.h:32: error: function definition does not declare parameters<br>/usr/include/qgis/qgssnapper.h:58: error: function definition does not declare parameters<br>
In file included from /usr/include/qgis/qgsvectorlayer.h:32,<br>                 from main.cpp:10:<br>/usr/include/qgis/qgsfield.h:29: error: function definition does not declare parameters<br>/usr/include/qgis/qgsfield.h:147: error: ‘QgsField’ was not declared in this scope<br>
/usr/include/qgis/qgsfield.h:147: error: template argument 2 is invalid<br>/usr/include/qgis/qgsfield.h:147: error: invalid type in declaration before ‘;’ token<br>In file included from main.cpp:10:<br>/usr/include/qgis/qgsvectorlayer.h:57: error: function definition does not declare parameters<br>
In file included from main.cpp:11:<br>/usr/include/qgis/qgsmapcanvas.h:62: error: function definition does not declare parameters<br>/usr/include/qgis/qgsmapcanvas.h:93: error: function definition does not declare parameters<br>
main.cpp: In function ‘int main(int, char**)’:<br>main.cpp:22: error: ‘QgsApplication’ was not declared in this scope<br>main.cpp:22: error: expected `;&#39; before ‘app’<br>main.cpp:30: error: ‘QgsProviderRegistry’ has not been declared<br>
main.cpp:33: error: invalid use of incomplete type ‘struct QgsVectorLayer’<br>/usr/include/qgis/qgsrenderer.h:22: error: forward declaration of ‘struct QgsVectorLayer’<br>main.cpp:34: error: ‘QgsSingleSymbolRenderer’ was not declared in this scope<br>
main.cpp:34: error: ‘mypRenderer’ was not declared in this scope<br>main.cpp:34: error: expected type-specifier before ‘QgsSingleSymbolRenderer’<br>main.cpp:34: error: expected `;&#39; before ‘QgsSingleSymbolRenderer’<br>
main.cpp:35: error: ‘QgsMapCanvasLayer’ was not declared in this scope<br>main.cpp:35: error: template argument 1 is invalid<br>main.cpp:35: error: invalid type in declaration before ‘;’ token<br>main.cpp:37: error: invalid use of incomplete type ‘struct QgsVectorLayer’<br>
/usr/include/qgis/qgsrenderer.h:22: error: forward declaration of ‘struct QgsVectorLayer’<br>main.cpp:38: error: invalid use of incomplete type ‘struct QgsVectorLayer’<br>/usr/include/qgis/qgsrenderer.h:22: error: forward declaration of ‘struct QgsVectorLayer’<br>
main.cpp:48: error: ‘QgsMapLayerRegistry’ has not been declared<br>main.cpp:50: error: request for member ‘append’ in ‘myLayerSet’, which is of non-class type ‘int’<br>main.cpp:52: error: ‘QgsMapCanvas’ was not declared in this scope<br>
main.cpp:52: error: ‘mypMapCanvas’ was not declared in this scope<br>main.cpp:52: error: expected type-specifier before ‘QgsMapCanvas’<br>main.cpp:52: error: expected `;&#39; before ‘QgsMapCanvas’<br>main.cpp:53: error: invalid use of incomplete type ‘struct QgsVectorLayer’<br>
/usr/include/qgis/qgsrenderer.h:22: error: forward declaration of ‘struct QgsVectorLayer’<br>main.cpp:63: error: ‘app’ was not declared in this scope<br>main.cpp: At global scope:<br>main.cpp:19: warning: unused parameter ‘argc’<br>
main.cpp:19: warning: unused parameter ‘argv’<br>make[1]: *** [debug/main.o] Error 1<br>make: *** [debug] Error 2<br>make[1]: Leaving directory `/home/matt/workspace/QGIS_Test2&#39;<br><br>