C++ POCO lib Linking Error when trying static linking VS9 express

别等时光非礼了梦想. 提交于 2019-12-08 00:22:25

Make sure that you build both the Poco libs and your project against the same C runtime (static/dynamic, debug/release, multithreaded).

The library "PocoFoundationmt.lib" which you are using is built with "release static" mode. From the project you ran looks like you need debug version of library which should be "PocoFoundationmtd.lib".

As you can see from the error log there is a conflict in linking. That is you said compiler the runtime-library is MDd, but you are linking to a release version library. Make sure in your ProjectProperties->Linker you are not linking to anyother libraries and do link to "PocoFoundationmtd.lib". Make sure to choose "Debug" instead of "Release" at top(near run button) of your project.Also Define POCO_STATIC.

I just did this, as Chadwick mentioned, you don't need the Foundation_EXPORTS preprocessor flag.

Also if you set the additional lib directory to poco lib, you don't need to specify the type of dll i.e. MT, Debug etc.

You only need POCO_STATIC as the preprocessor flag.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!