I am receiving the following errors in my win32 api code in devc++:
[Linker error] undefined reference to `EnumProcessModules@16'
[Linker error] undefined reference to `GetModuleFileNameExA@16'
ld returned 1 exit status
#pragma comment(lib, "psapi.lib")
Link with the library that provides the missing functions.
As mentioned in the question comments, g++ (which most likely is the compiler that you’re using with DevC++) does unfortunately not support
Also, as mentioned in the question comments, DevC++ is a rather outdated and ungood IDE. Since you are using Windows, try out e.g. Code::Blocks IDE for the g++ compiler, or Microsoft’s Visual C++ Express IDE for Visual C++. And with the latter you can use the
#pragma, if you want…