<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br><br>--- On <b>Wed, 3/4/09, Tim Sutton <i><tim@linfiniti.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: Tim Sutton <tim@linfiniti.com><br>Subject: Re: [Qgis-developer] HELP!!geometryType() problem!!!<br>To: "bonar" <bonar_reddevil@yahoo.com><br>Cc: qgis-developer@lists.osgeo.org<br>Date: Wednesday, March 4, 2009, 2:53 PM<br><br><pre>bonar wrote:<br>> i have a problem on compiling Tim Sutton's QGis Code Examples. Its<br>give me an<br>> error on this code<br>><br>> "QgsSingleSymbolRenderer *mypRenderer = new<br>> QgsSingleSymbolRenderer(mypLayer->geometryType());"<br>> <br>> no matching function for call to<br>> `QgsSingleSymbolRenderer::QgsSingleSymbolRenderer(QGis::WKBTYPE)'.<br>><br>> <br>Thats odd since in
qgssinglesymbolrenderer.h we have:<br><br> 26 class CORE_EXPORT QgsSingleSymbolRenderer: public QgsRenderer<br> 27 {<br> 28 public:<br> 29 QgsSingleSymbolRenderer( QGis::GeometryType type );<br><br>and from qgsvectorlayer.h we have:<br><br>163 /** Returns point, line or polygon */<br>164 QGis::GeometryType geometryType() const;<br><br>So your first attempt should have been correct and working. Are you sure<br>you have 1.0 final and no stray headers from older versions?<br><br>8<-------------snip<br><br>> Example 1 and 2 give this same error to me. What is a different between<br>> vectorType() and geometryType()? For your info,i'm using QGis 1.0 and<br>run on<br>> Windows platform. Please help me,i'm new to QGis.<br>> <br><br>If I recall vectorType was dropped in favour of geometryType in the<br>API revisions leading up to the release of QGIS 1.0.<br>><br>> Thanks in advance,<br>> Bonar <br>>
<br><br>Regards<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 you issue will be shared with all.<br><br>Visit http://linfiniti.com 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 freenode.net<br>==============================================<br><br>Hi all,<br><br> Mr.Tim Sutton thanks for your reply, i really appreciate your help. Sorry for late reply, <br> lately i'm doing QGis development under Linux Red Hat because of QGis installations <br> on Windows problems. It's going really well for Linux but sadly i still need to make a <br> development
under Windows because of some issuese. Based on your email, i already make <br> a new QGis installations on Windows from source. I'm using QGis 1.0 + Qt4.4.3, but i still<br> have no luck, this time i get different error:<br><br> undefined reference to `_imp___ZN12QgsMapCanvas9setExtentERK12QgsRectangle'<br> undefined reference to `_imp___ZN23QgsSingleSymbolRendererC1EN4QGis12GeometryTypeE'<br> CMakeFiles\timtut1.dir\main.cpp.obj In function `main':<br> make: *** [all] Error 2<br> make[1]: *** [CMakeFiles/timtut1.dir/all] Error 2<br> make[2]: *** [timtut1.exe] Error 1<br><br> Really hope your help in this matters because i already out of ideas about this errors.<br><br> Another questions, sorry because asking different question on same topic but if you think <br> i should make a new post for this question, i will do it as it should. Regarding my <br> development on Linux Red Hat, how can i load PostGIS layer into my
QGis application? <br> This is my pieces of code about how i do it:<br><br> QgsDataSourceURI * uri = new QgsDataSourceURI();<br> // set host name, port, database name, username and password<br> uri->setConnection("localhost", "5432", "postgis", "postgres", "postgres");<br> // set database schema, table name, geometry column and optionaly subset (WHERE clause)<br> uri->setDataSource("public", "klkv_poi2", "the_geom", "id=4");<br> QgsVectorLayer * mypLayerPoi = new QgsVectorLayer(uri->uri(), myLayerBaseNamePoi, "postgres");<br><br> This code give me error:<br><br> Layer Not Valid<br><br> Hope you can give me an advice for this matters.<br><br><br> Thanks in advance,<br><br> bonar<br><br></pre></blockquote></td></tr></table><br>