I am building an app using qgis in Windows 7 with VS 2008. It was diagnosed that I must have the wrong versions of the libraries because of a potential name mangling problem. I have 12 unresolved externals and I can find them in gis_core by micreosoft name. Does anyone have a different library for me to link to?

  • Can you please add what library you are currently using to the question – Kelso Dec 12 '12 at 3:50
  • I am using the lib called c:\OSgeo4W\apps\qgis\lib\qgis_core.lib. It is dated with a create date of 11/13/2012. I downloaded it from the OSGeo4W site and the link on the main page, trac.osgeo.org/osgeo4w. I am not sure how to get the original version number of it. It is not included in the file properties. – Tygh Porak Dec 12 '12 at 4:19

Does your project have the option Treat wchar_t as a built-in type turned on?

Assuming QGIS is built against a default version of Qt on Windows, Qt has Treat wchar_t as a built-in type turned off. So the library you're linking with probably has no idea what wchar_t is

Another thing to note is that Qt is more than just a C++ library/framework. It uses its own pre-compiler (moc) to set up reflection and signals/slots in your classes. If you created your project in raw Visual Studio, it won't know to run moc against your code first before compiling it. Whereas QtCreator or a project created by Qt's Visual Studio addin does.

  • Yes, you are right the Treat wchar_t as a built-in type was turned on. I turned it off and still the same results. The same unresolved symbols. – Tygh Porak Dec 12 '12 at 6:16
  • I did a little more digging and found that I have 2 types of unresolved symbols. At least one is coming from QT. I also found a link that talks of the same problem. "Unresolved external symbol "staticMetaObject". Since I am not building the qtcore4 library myself, I would not know where to change. This is the only QT library I am linking to. I tried versions 4.8.4 & 4.6.4. – Tygh Porak Dec 12 '12 at 6:24
  • The other commonality of symbol types are ones that include VERSION_INT as part of the name. example: QgsApplication::mGdalSkipListVERSION_INT – Tygh Porak Dec 12 '12 at 6:29
  • Updated answer to cover Qt's moc – jumpinjackie Dec 12 '12 at 9:43
  • Thank you. Actually I am not atempting to write a QT plugin and not sure why the references were called for by the linker. What I am trying to do is write a custom dll that currently handles device control bt needs to run a good dissolve routine on a basic shape file. I posted my current code segment in the question "How do I add QGIS dissolve function to my C++ Windows ATL program." – Tygh Porak Dec 13 '12 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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