Advertisement Jump to content
Sign in to follow this  

[FreeType] FT_New_Face Crashing?

This topic is 2597 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'm trying to set up FreeType to work on VS2008. I've managed to get everything to compile and link properly, but whenever I call FT_New_Face the program crashes to the _file.c file at line 242. Here is the code I'm using at the moment:

#include <windows.h>
#pragma comment( lib, "freetype248.lib" )
#include <ft2build.h>
#include FT_FREETYPE_H

int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow )
FT_Library library;
int error = FT_Init_FreeType( &library );
if ( error )
MessageBox( 0, "Error with library", "Error", 0 );

FT_Face face;
error = FT_New_Face( library, "test.ttf", 0, &face ); // THE ERROR IS HERE!!
if ( error == FT_Err_Unknown_File_Format )
MessageBox( 0, "Unknown format", "Error", 0 );
else if ( error )
MessageBox( 0, "Error with face", "Error", 0 );

return 0;

test.tff is a valid TFF file (I've tried different files). The call stack is a bit like this (if it helps):

Any help is much appreciated. Or if you can point me to a resource that shows how to install it correctly, that would also be great.

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!