ATL Based Linker Errors

帅比萌擦擦* 提交于 2019-12-05 11:01:49
Vlalex

In project settings change "Use of ATL" from "Dynamic Link to ATL" to "Static Link to ATL".

Larry

I had to debug this issue as well. Seems the DLL bulid is not working since a number of functions are missing in atl.lib. I switched "Use of ATL" to "Static link to ATL". After that I had only 3 missing symbols left and I found that these are defined within atlthunk.lib. This one is never referenced in atlbase.h. That's why I added

#pragma comment(lib, "atlthunk.lib")

to atlbase.h right before the debug yes/no section for atls.lib/atlsd.lib

After that the build was successfull.

atls.lib is ATL's static library. atlsd.lib is that library's debug version. You're linking to both on the same build, so you get multiple definitions. In addition, atl.lib is what you should link to if you want to use ATL's dynamic library. So, either use atl.lib, or use atls.lib in your release build and atlsd.lib in your debug build. But don't mix them together.

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