Question

I'm currently trying to learn how to use the FreeType2 library for drawing fonts with OpenGL. However, when I start the program it immediately crashes with the following error: "(Can't correctly start the application (0xc000007b))"

Commenting the FT_Init_FreeType removes the error and my game starts just fine. I'm wondering if it's my code or has something to do with loading the dll file.

My code:

#include "SpaceGame.h"
#include <ft2build.h>
#include FT_FREETYPE_H

//Freetype test
FT_Library library;

Game::Game(int Width, int Height)
{

    //Freetype
    FT_Error error = FT_Init_FreeType(&library);
    if(error)
    {
        cout << "Error occured during FT initialisation" << endl;
    }

And my current use of the FreeType2 files. Inside my bin folder (where debug .exe is located) is: freetype6.dll, libfreetype.dll.a, libfreetype-6.dll. In Code::Blocks, I've linked to the lib and include folder of the FreeType 2.3.5.1 version. And included a compiler flag: -lfreetype

My program starts perfectly fine if I comment out the FT_Init function which means the includes, and library files should be fine.

Était-ce utile?

La solution

For people who might stumble upon the same problem and can't find it out. I'll post my solution:

It seemed the error code ussualy comes up with loading .dll's. I used process explorer to check if my program was actually loading the correct .dll but it wasn't. I deleted my FreeType dll's and replaced them with a version compiled specifically for my version of windows to make sure I have the right dll's. Replacing the old one with the new one helped.

Autres conseils

I had the same problem, turnes out that I had forgotten to copy over the zlib1.dll file.

I had the same "cant correctly start" error. It turned out my program was finding a zlib1.dll in something like c:\intel\wifi\bin, that DependencyWalker flagged as AMD64 (my PC is Win7 64, but my app is 32 bits.) It was fixed when I copied freeType's zlib1.dll to SysWOW64. Tough nut to crack!

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top