Unresolved external symbols in compiling 32 bit application in Windows 64

随声附和 提交于 2019-12-03 11:49:58

So I finally figured it out, kinda... It wasnt finding psapi.lib

In Project->Linker->Additional dependencies instead of just saying psapi.lib I gave full path to it and it worked... not really sure why it failed to find it before but oh well...

This is very long shot (and I don't really believe this is it) but maybe the headers are not properly guarded with extern "C" for c++ compilation? Are you including system headers or just declaring the functions yourself?

Can you post your compile and link command lines, and any #def's in your code?

Does this happen if you make a simple project from scratch that only calls one of those methods?

For the record: Same problem, different solution; I had an entry for the directory

psapi 

added in the list of

Linker/General/Additional Library Directory 

This resulted in the usage of the old VS2005 platform sdk psapi.lib (it only had x86, no x64 version). After removing the entry the correct lib from the installed WinSDK x64/psapi.lib is used now. So keep an eye out for mixings/ordering of old & new SDKs! Obviously the full path will also work but might be a problem when you use the project on multiple machines.

In my case(migrate from VS2008 to VS2012), issue solved after adding psapi.lib in Linker->input->Additional Dependencies in VS 2012.

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