The value of ESP was not properly saved across a function call…

The value of ESP was not properly saved across a function call…

Windows can trigger this error, but sometimes it’s not easy to figure out what’s going on.

I recently got this error when trying to use the OpenGL ES ANGLE library on Windows 10. When compiling against the ANGLE library, the error came when trying to call into the ANGLE and used eglGetProcAddress().

eglGetProcAddress() returns function pointers for important GL extensions, so I couldn’t just ignore it or work around it.

In looking around, the obvious first step is to make sure you’re defining the function pointers correctly, but that turns out not to be my problem.

In looking at this article, I realized I probably had a mismatch of compiler and linker settings. The Visual Studio projects (VS2008) that came with ANGLE required a certain set of compiler and linker flags that were not standard. I had migrated the Visual Studio projects to VS2015, so that also added an element of uncertainty. I simply opened both project settings up next to each other and compared the settings for the ANGLE library build and the final project and found a few mismatches. I change a number of them to be the same, and things worked great.

Check the linking AND compiling flags for not only your project, but the project files that generate the libraries you’re linking against. Differences in compiler settings can cause this error.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.