Tim,<br><br>Thanks for the suggestion, I really appreciate your help. <br><br>I added the code below to my *.pro file and it runs now, but with some errors which I need to look into still.<br><br>Added code:<br> ADD_DEFINITIONS(-DGUI_EXPORT=)<br>
ADD_DEFINITIONS(-DCORE_EXPORT=)<br> ADD_DEFINITIONS(-DPYTHON_EXPORT=)<br><br>I am now getting this message when I try to run it:<br> QgsCoordinateReferenceSystem::findMatchingProj will only work if prj acr ellipsoid acr and proj4string are set!...<br>
Layer is valid<br> QgsCoordinateReferenceSystem::findMatchingProj will only work if prj acr ellipsoid acr and proj4string are set!...<br><br>Some times it runs, sometimes it doesn't after these messages (??).<br><br>
As a follow-up, do the tutorials need to be compiled against the full source code or should they work with only the install from the repository? I have it "working" with the full source code but am wondering if this is necessary.<br>
<br>Thanks Again,<br><br>Matt<br><br><br><div class="gmail_quote">On Sun, Jun 21, 2009 at 12:19 PM, Tim Sutton <span dir="ltr"><<a href="mailto:lists@linfiniti.com">lists@linfiniti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA1<br>
<br>
Hi Matthew<br>
<br>
I'm not familiar with eclipse as a C++ IDE but I wonder if you have<br>
declared the compiler constants -DCORE_EXPORT , -DGUI_EXPORT and<br>
- -DPYTHON_EXPORT. It should be fine to declare them as empty vars if you<br>
are under Linux. This is just a shot in the dark since as I mentioned<br>
I've never tried to build under eclipse.<br>
<br>
Regards<br>
<br>
Tim<br>
<div><div></div><div class="h5"><br>
Matthew Denno wrote:<br>
> Hello List,<br>
><br>
> I am wondering if someone can help me get the C++ tutorials to compile using<br>
> 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<br>
> runs but doesn'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" target="_blank">http://blog.qgis.org/node/10</a> to the<br>
> automatically generated main.cpp file.<br>
><br>
> I have also tried to reference the QGIS version 1.2.0 that was compiled<br>
> locally, but no luck.<br>
><br>
> When I try to compile the project it looks like the QGIS classes are not<br>
> recognized and I get the errors below. It looks like it is finding the *.h<br>
> 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<br>
> 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'<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<br>
> -DQT3_SUPPORT -DQT_SQL_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB<br>
> -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I.<br>
> -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui<br>
> -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml<br>
> -I/usr/include/qt4/QtSql -I/usr/include/qt4/Qt3Support<br>
> -I/usr/include/qt4/QtSvg -I/usr/include/qt4 -I/usr/include/qgis<br>
> -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<br>
> declare parameters<br>
> In file included from main.cpp:7:<br>
> /usr/include/qgis/qgsproviderregistry.h:39: error: function definition does<br>
> 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<br>
> 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<br>
> declare parameters<br>
> In file included from main.cpp:8:<br>
> /usr/include/qgis/qgssinglesymbolrenderer.h:26: error: function definition<br>
> does not declare parameters<br>
> /usr/include/qgis/qgssinglesymbolrenderer.h:68: error:<br>
> ‘QgsSingleSymbolRenderer’ has not been declared<br>
> /usr/include/qgis/qgssinglesymbolrenderer.h:68: error: non-member function<br>
> ‘const QgsSymbol* symbol()’ cannot have cv-qualifier<br>
> /usr/include/qgis/qgssinglesymbolrenderer.h: In function ‘const QgsSymbol*<br>
> symbol()’:<br>
> /usr/include/qgis/qgssinglesymbolrenderer.h:70: error: ‘mSymbol’ was not<br>
> declared in this scope<br>
> /usr/include/qgis/qgssinglesymbolrenderer.h: At global scope:<br>
> /usr/include/qgis/qgssinglesymbolrenderer.h:73: error:<br>
> ‘QgsSingleSymbolRenderer’ has not been declared<br>
> /usr/include/qgis/qgssinglesymbolrenderer.h:73: error: non-member function<br>
> ‘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<br>
> 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<br>
> parameters<br>
> /usr/include/qgis/qgspoint.h:138: error: expected ‘,’ or ‘...’ before ‘&’<br>
> token<br>
> /usr/include/qgis/qgspoint.h:138: error: ISO C++ forbids declaration of<br>
> ‘QgsPoint’ with no type<br>
> /usr/include/qgis/qgspoint.h:138: error: ‘bool operator==(int)’ must have an<br>
> argument of class or enumerated type<br>
> /usr/include/qgis/qgspoint.h:146: error: expected ‘,’ or ‘...’ before ‘&’<br>
> token<br>
> /usr/include/qgis/qgspoint.h:146: error: ISO C++ forbids declaration of<br>
> ‘QgsPoint’ with no type<br>
> /usr/include/qgis/qgspoint.h: In function ‘std::ostream&<br>
> operator<<(std::ostream&, 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<br>
> declare parameters<br>
> /usr/include/qgis/qgsrectangle.h:134: error: expected initializer before<br>
> ‘::’ token<br>
> /usr/include/qgis/qgsrectangle.h:138: error: ‘QgsRectangle’ has not been<br>
> 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<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h: At global scope:<br>
> /usr/include/qgis/qgsrectangle.h:143: error: ‘QgsRectangle’ has not been<br>
> 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<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h: At global scope:<br>
> /usr/include/qgis/qgsrectangle.h:148: error: ‘QgsRectangle’ has not been<br>
> 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<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h: At global scope:<br>
> /usr/include/qgis/qgsrectangle.h:153: error: ‘QgsRectangle’ has not been<br>
> 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<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h: At global scope:<br>
> /usr/include/qgis/qgsrectangle.h:158: error: ‘QgsRectangle’ has not been<br>
> declared<br>
> /usr/include/qgis/qgsrectangle.h:158: error: non-member function ‘double<br>
> 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<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h: At global scope:<br>
> /usr/include/qgis/qgsrectangle.h:163: error: ‘QgsRectangle’ has not been<br>
> declared<br>
> /usr/include/qgis/qgsrectangle.h:163: error: non-member function ‘double<br>
> 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<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h: At global scope:<br>
> /usr/include/qgis/qgsrectangle.h:168: error: ‘QgsRectangle’ has not been<br>
> declared<br>
> /usr/include/qgis/qgsrectangle.h:168: error: non-member function ‘double<br>
> 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<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h: At global scope:<br>
> /usr/include/qgis/qgsrectangle.h:173: error: ‘QgsRectangle’ has not been<br>
> declared<br>
> /usr/include/qgis/qgsrectangle.h:173: error: non-member function ‘double<br>
> 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<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h: At global scope:<br>
> /usr/include/qgis/qgsrectangle.h:178: error: ‘QgsRectangle’ has not been<br>
> declared<br>
> /usr/include/qgis/qgsrectangle.h:178: error: non-member function ‘double<br>
> 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<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h:180: error: ‘xmin’ was not declared in this<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h: At global scope:<br>
> /usr/include/qgis/qgsrectangle.h:183: error: ‘QgsRectangle’ has not been<br>
> declared<br>
> /usr/include/qgis/qgsrectangle.h:183: error: non-member function ‘double<br>
> 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<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h:185: error: ‘ymin’ was not declared in this<br>
> 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<br>
> ‘&’ token<br>
> /usr/include/qgis/qgsrectangle.h:192: error: ISO C++ forbids declaration of<br>
> ‘QgsRectangle’ with no type<br>
> /usr/include/qgis/qgsrectangle.h: In function ‘std::ostream&<br>
> operator<<(std::ostream&, int)’:<br>
> /usr/include/qgis/qgsrectangle.h:192: error: redefinition of ‘std::ostream&<br>
> operator<<(std::ostream&, int)’<br>
> /usr/include/qgis/qgspoint.h:146: error: ‘std::ostream&<br>
> operator<<(std::ostream&, int)’ previously defined here<br>
> /usr/include/qgis/qgsrectangle.h:194: error: ‘r’ was not declared in this<br>
> scope<br>
> /usr/include/qgis/qgsrectangle.h: At global scope:<br>
> /usr/include/qgis/qgsrectangle.h:192: warning: unused parameter<br>
> ‘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<br>
> 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<br>
> 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<br>
> declare parameters<br>
> /usr/include/qgis/qgssnapper.h:58: error: function definition does not<br>
> 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<br>
> parameters<br>
> /usr/include/qgis/qgsfield.h:147: error: ‘QgsField’ was not declared in this<br>
> 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<br>
> ‘;’ token<br>
> In file included from main.cpp:10:<br>
> /usr/include/qgis/qgsvectorlayer.h:57: error: function definition does not<br>
> declare parameters<br>
> In file included from main.cpp:11:<br>
> /usr/include/qgis/qgsmapcanvas.h:62: error: function definition does not<br>
> declare parameters<br>
> /usr/include/qgis/qgsmapcanvas.h:93: error: function definition does not<br>
> 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 `;' 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<br>
> 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 `;' 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<br>
> 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<br>
> 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<br>
> 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 `;' 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<br>
> 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'<br>
><br>
><br>
><br>
</div></div>> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Qgis-developer mailing list<br>
> <a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br>
<br>
- --<br>
<br>
Tim Sutton - QGIS Project Steering Committee Member (Release Manager)<br>
==============================================<br>
Please do not email me off-list with technical<br>
support questions. Using the lists will gain<br>
more exposure for your issues and the knowledge<br>
surrounding your issue will be shared with all.<br>
<br>
Visit <a href="http://linfiniti.com" target="_blank">http://linfiniti.com</a> to find out about:<br>
* QGIS programming and support services<br>
* Mapserver and PostGIS based hosting plans<br>
* FOSS Consulting Services<br>
Skype: timlinux<br>
Irc: timlinux on #qgis at <a href="http://freenode.net" target="_blank">freenode.net</a><br>
==============================================<br>
<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.9 (GNU/Linux)<br>
Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br>
<br>
iEYEARECAAYFAko+XXIACgkQqk07qZdiYjdWEQCfQ7T9uOkK86WmYAQ+e0yett6Q<br>
losAoL45e+VMUvlxVDOAKYW8VhkVOqSm<br>
=4Ifu<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div><br>