Upon attempting to compile my code I get the following error:
"The application was unable to start correctly (0x000007b). Click ok to close
the application.
I know the problem is most likely associated with my SDL2_ttf library. I have no problem linking the library, however, The following code when commented
rids of the issue:
Code:
SDL_Texture* CSprite::RenderText(std::string message, std::string fontFile, SDL_Color color, int fontSize)
{
//Open the font
TTF_Font *font = nullptr;
//font = TTF_OpenFont(fontFile.c_str(), fontSize);
//if (font == nullptr)
//throw std::runtime_error("Failed to load font: " + fontFile + TTF_GetError());
//Render the message to an SDL_Surface, as that's what TTF_RenderText_X returns
SDL_Surface *surf = TTF_RenderText_Blended(font, message.c_str(), color);
SDL_Texture *texture = SDL_CreateTextureFromSurface(surface, surf);
//Clean up unneeded stuff
//SDL_FreeSurface(surf);
//TTF_CloseFont(font);
return texture;
}
I didn’t have problems at all relating this until I linked the SDL2_ttf library to my project and tried running this function. Currently how it is shown above will result in the previously described error. I have already tried the following solutions from other websites online:
rebooting computer.
reinstalling Net.dll (I believe is what its called)
re-linking the libraries
reinstalling Visual Studios 2013 (which is the compiler I am currently using
by the way, on windows 7)
Pasting all code into a different project that was linked correctly
Tried moving around the dll to System32 folder and SysWow (whatever its called)
Currently have dll in debug folder
Also tried x86 and x64 dll files
I only have this problem with the SDL2_ttf library, I have SDL2, SDL2_image and SDL2_mixer linked just fine. Although I have not actually tried using the mixer.
Any help or insight would be much appreciated. Thanks so much