Jump to content
  • Advertisement
Sign in to follow this  
Tera_Dragon

Can't get FTGL to work

This topic is 4504 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've built the libs and dll, but to be able to build the dynamic lib and dll I had to change the freetype included lib from freetype204MT_D.lib to freetype.lib as that was the only freetype lib I had. It seemed to work though. I included the libs and added the dll to my project directory, but when I run it I get the following error: File: i386/chkesp.c Line: 42 The value of ESP was not properly saved across a function call. This is usually the result of calling a function declared with one calling convention with a function pointer declared with a different calling convention I'm not sure where I should even start with this...

Share this post


Link to post
Share on other sites
Advertisement
I had a hell of a time trying to get FTGL to work and eventually just moved on to GLFT_Font which was written by our very own cozman. I know it doesn't help get FTGL going but it's another GL font solution.

Share this post


Link to post
Share on other sites
Find what function it's referring to (use the call stack), and check its calling convention. Does FTGL use LoadLibrary() and GetProcAddress() at all? That's uaully where you'll see these problems - the function may be using __stdcall in the DLL, but the function prototype (how it's called) may be using __cdecl.

The other alternative is stack corruption...

Share this post


Link to post
Share on other sites
The function it's referring to is either ftgl_dynamic_MTD_d.dll!FTLibrary::Instance() or MSVCRTD.DLL!__chkesp(). __chkesp is the last one on the stack, and it looks like the error occurs just after calling it (I'm not familiar with doing this).
I can't work out how to find the calling convention of the functions.

Share this post


Link to post
Share on other sites
Ignore checkesp, that's added by the compiler to catch bugs like this. So the problem is in FTLibrary::Instance() in ftgl_dynamic_MTD_d.dll.
I'm not sure if there's a problem with calling conventions if that's a member function. Although it's begining to sound like FTGL is just borked :P

To check the calling conventions for normal functions, just find the declaration of the function. If it's something like int __stdcall foo(); then it's declared to use the stdcall calling convention. If it's not mentioned, then it's __cdecl.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!