<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi,<br>
<br>
I traced this error to the use of qobject_cast in lines like:<br>
<br>
QgsVectorLayer* vlayer = qobject_cast<QgsVectorLayer *>(
mCanvas->currentLayer() );<br>
<br>
If I change those lines to use dynamic_cast the linker error
disappear in Windows.<br>
<br>
Any idea why?<br>
<br>
Many thanks,<br>
Carlos.<br>
<br>
On 08/10/2012 05:42 PM, SupportLists wrote:<br>
</div>
<blockquote cite="mid:50251DE0.5050707@qlands.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
Hi,<br>
<br>
I am building a custom application use QGIS 1.8.0 but I get the
following error:<br>
<br>
<i><small><small> link /LIBPATH:"c:\Qt\4.8.1\lib" /NOLOGO
/DYNAMICBASE /NXCOMPAT /DEBUG /M<br>
ANIFEST /MANIFESTFILE:"debug\nile.intermediate.manifest"
/SUBSYSTEM:WINDOWS "/MA<br>
NIFESTDEPENDENCY:type='win32'
name='Microsoft.Windows.Common-Controls' version='<br>
6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*'
processorArchitecture='*<br>
'" /OUT:debug\nile.exe
@C:\DOCUME~1\CARLOS~1\LOCALS~1\Temp\nmF.tmp<br>
mapwidget.obj : error LNK2001: unresolved external symbol
"public: static struct<br>
QMetaObject const QgsVectorLayer::staticMetaObject"
(?staticMetaObject@QgsVecto<br>
rLayer@@2UQMetaObject@@B)<br>
maptoolselect.obj : error LNK2001: unresolved external
symbol "public: static st<br>
ruct QMetaObject const QgsVectorLayer::staticMetaObject"
(?staticMetaObject@QgsV<br>
ectorLayer@@2UQMetaObject@@B)<br>
mapwidget.obj : error LNK2001: unresolved external symbol
"public: static struct<br>
QMetaObject const QgsRasterLayer::staticMetaObject"
(?staticMetaObject@QgsRaste<br>
rLayer@@2UQMetaObject@@B)<br>
debug\nile.exe : fatal error LNK1120: 2 unresolved externals<br>
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft
Visual Studio 10.0\VC\BI<br>
N\link.EXE"' : return code '0x460'<br>
Stop.<br>
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft
Visual Studio 10.0\VC\BI<br>
N\nmake.exe"' : return code '0x2'<br>
Stop.</small></small></i><br>
<br>
My .pro file is defined as:<br>
<br>
<i><small><small>QT += core gui sql xml<br>
<br>
TARGET = nile<br>
TEMPLATE = app<br>
<br>
unix:INCLUDEPATH += /usr/local/gis/include/qgis
/usr/local/gis/include ./mapviewsrc<br>
win32:INCLUDEPATH += C:/QGIS/apps/qgis/include
C:/QGIS/include ./mapviewsrc<br>
<br>
unix:LIBS += -L/usr/local/gis/lib -lgdal -lgeos -lqgis_core
-lqgis_gui<br>
win32:LIBS += C:/QGIS/apps/qgis/lib/qgis_core.lib
C:/QGIS/apps/qgis/lib/qgis_gui.lib C:/QGIS/lib/geos_c_i.lib
C:/QGIS/lib/gdal_i.lib<br>
<br>
<br>
DEFINES += QGISPLUGINDIR=$${QGISPLUGINDIR} CORE_EXPORT=
GUI_EXPORT=</small></small></i><br>
<br>
I am using QT 4.8.1 and Visual Studio 2010.<br>
<br>
Any idea what is causing the error and how to correct it?<br>
<br>
Many thanks in advance,<br>
Carlos<br>
<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Qgis-developer mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a>
</pre>
</blockquote>
<br>
<br>
</body>
</html>