[Qgis-developer] Problem compiling PyQGIS binding on Win32 w/MSVC

Gary Sherman sherman at mrcc.com
Sat Dec 1 11:17:04 EST 2007

While other have reportedly done this, I'm getting the following error  
when trying to build the bindings:

------ Build started: Project: python, Configuration: Release Win32  
Generating gui/gui.pyd
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation.  All rights reserved.
    Creating library gui.lib and object gui.exp
sipguiQgsMessageViewer.obj : error LNK2001: unresolved external symbol  
"public: virtual void * __thiscall QgsMessageViewer::qt_metacast(char  
const *)" (?qt_metacast at QgsMessageViewer@@UAEPAXPBD at Z)
sipguiQgsMessageViewer.obj : error LNK2019: unresolved external symbol  
"__declspec(dllimport) public: virtual struct QMetaObject const *  
__thiscall QgsMessageViewer::metaObject(void)const " (__imp_? 
metaObject at QgsMessageViewer@@UBEPBUQMetaObject@@XZ) referenced in  
function "public: virtual struct QMetaObject const * __thiscall  
sipQgsMessageViewer::metaObject(void)const " (? 
metaObject at sipQgsMessageViewer@@UBEPBUQMetaObject@@XZ)
sipguiQgsMessageViewer.obj : error LNK2019: unresolved external symbol  
"__declspec(dllimport) public: virtual int __thiscall  
QgsMessageViewer::qt_metacall(enum QMetaObject::Call,int,void *  
*)" (__imp_? 
qt_metacall at QgsMessageViewer@@UAEHW4Call at QMetaObject@@HPAPAX at Z)  
referenced in function "public: virtual int __thiscall  
sipQgsMessageViewer::qt_metacall(enum QMetaObject::Call,int,void *  
*)" (?qt_metacall at sipQgsMessageViewer@@UAEHW4Call at QMetaObject@@HPAPAX at Z)
gui.pyd : fatal error LNK1120: 3 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio  
8\VC\bin\link.EXE"' : return code '0x460'

It looks to me to be a problem with the moc generated file not being  
linked in the qgis library, but I can't seem to trace the cause. I  
suppose it could be in the sip code as well.

Gary Sherman
Chair, QGIS Project Steering Committee
-Micro Resources: http://mrcc.com
   *Geospatial Hosting
   *Web Site Hosting
-Desktop GIS Book:
"We work virtually everywhere"

More information about the Qgis-developer mailing list