Harikrishna R
Harikrishna R

Reputation: 317

Entry point not found error in Vista OS

I have a C++ project in VS2010 and upgrade it in VS2013. I am using win7 os and it is working fine. The out put is an exe file and I tried to run this executable in Vista OS but it crashed with showing an error message as "The procedure entry point K32EnumProcessModules could not be located in the dynamic link lybrary KERNEL32.dll" How can I fix this issue?

Upvotes: 0

Views: 1408

Answers (1)

Mike Vine
Mike Vine

Reputation: 9837

See the documentation for EnumProcessModules specifically this part:

Programs that must run on earlier versions of Windows as well as Windows 7 and later versions should always call this function as EnumProcessModules. To ensure correct resolution of symbols, add Psapi.lib to the TARGETLIBS macro and compile the program with -DPSAPI_VERSION=1. To use run-time dynamic linking, load Psapi.dll.

Which basically means:

Use EnumProcessModules in your code

Link to Psapi.lib

Set up PSAPI_VERSION=1 as a preprocessor definition

Upvotes: 2

Related Questions