I'm developing a software using QGIS. When building my software there is a LINK error.

1>mainwindow.obj : error LNK2019: symbole externe non résolu "public: __thiscall 
   QgsLegend::QgsLegend(class QgsMapCanvas *,class QWidget *,char const 
   *)"(??0QgsLegend@@QAE@PAVQgsMapCanvas@@PAVQWidget@@PBD@Z) référencé dans la 
   fonction "public: __thiscall MainWindow::MainWindow(class QWidget *,class 
   QFlags<enum Qt::WindowType>)" 
1>C:\Documents and Settings\XXXXX\mes documents\visual studio 2010\Projects\XXXXX
\XXXXXX.exe : fatal error LNK1120: 1 externes non résolus

I'm using QGIS 1.7.2, QT 4.7.3, Visual Studio 2010 (with VC10), and there were no errors when I built the sources of QGIS. I've already put all the .libs I found in the link editor of VS10. In QGIS API, it is written that for the QgsLegend, I had to link the qgis_gui.lib, so had I.

I don't know what I can do now. Can someone help me ? Or how to proceed in order to find the lib i missed.

If you need more information, just ask. I'm really blocked...

1 Answer 1


QgsLegend isn't part of the API. You can't use it in applications. Plugins can access it via QgsLegendInterface.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.