Entry Point Not Found - by sixstorm1

Status : 

  By Design<br /><br />
		The product team believes this item works according to its intended design.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 482418 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 8/11/2009 6:46:51 PM
Access Restriction Public



I just installed Visual Studio 2010 and converted a 2008 C++ Win32 project to 2010, but encountered a bug that prevent my application from being debugged. When I start debugging, I get "The procedure entry point K32EnumProcessModules could not be located in the dynamic link library KERNEL32.dll". I haven't had this error when compiling with 2008.

Included header: <Psapi.h>
C++ Linker Additional Dependencies: "Psapi.lib"

I just think the compiler is linking the EnumProcessModule to the wrong library. This function is found in Kernel32.dll but on Windows 7 only. It should link to Psaspi.
Sign in to post a comment.
Posted by sixstorm1 on 8/13/2009 at 3:16 PM
Thanks it works now. I added -DPSAPI_VERSION=1 to the additional command-line compile options. The documentation on this on MSDN is not very clear. You can close this issue.
Posted by Microsoft on 8/13/2009 at 12:30 PM
There were some changes in this area starting with the release of Windows Server 2008 R2. This MSDN article has some information that might help:


From the article:

"Starting with PSAPI version 2 for Windows 7 and Windows Server 2008 R2, this function is defined as K32EnumProcessModules in Psapi.h and exported in Kernel32.lib and Kernel32.dll. However, you should always call this function as EnumProcessModules. To ensure correct resolution of symbols for programs that will run on earlier versions of Windows, add Psapi.lib to the TARGETLIBS macro and compile the program with –DPSAPI_VERSION=1."

I hope this helps.
Posted by Microsoft on 8/13/2009 at 12:17 AM
Thanks for your feedback.

We were able to reproduce the issue you are seeing. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and

resolution. These specialized experts will follow-up with your issue.