The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Issue: (0x000007b), most likely related to SDL2_ttf
dtanderson5


Joined: 02 Apr 2014
Posts: 3
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
dtanderson5


Joined: 02 Apr 2014
Posts: 3
Correction: the error is actually "0xc000007b" I forgot the "c"
Issue: (0x000007b), most likely related to SDL2_ttf
Jonny D


Joined: 12 Sep 2009
Posts: 932
Is 'surface' an SDL_Renderer?  Which function is this crashing in?

Jonny D



On Wed, Apr 2, 2014 at 10:44 PM, dtanderson5 wrote:
Quote:
Correction: the error is actually "0xc000007b" I forgot the "c"


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

mr_tawan


Joined: 13 Jan 2014
Posts: 161
I saw a bunch of links when googling '0xc000007b' on Windows (https://www.google.co.th/search?q=0xc000007b). Looks like there's problem in some of the dll/library file you're using.

Have you tried building SDL2_ttf yourself ? What about freetype 2 ? These are just my wild guess as I have never been encountered these before.
LBandy


Joined: 01 Jan 2013
Posts: 38
I've experienced similar issues when
- using SDL_ttf built in VS2010 while working with a project in VS2008
- not linking (the correct) freetype.lib
dtanderson5


Joined: 02 Apr 2014
Posts: 3
My apologies, I kind of put my personal project off. However, I am back at it at the moment and have just found out that the following line of code causes the issue:

Code:

font = TTF_OpenFont("/data/boycott/BOYCOTT_.ttf", 30);


After the issue occurs, the error will persists even after I uncomment the previous line of code. However, if I comment #include <SDL_ttf.h>, run, then uncomment, and comment the above line it works. This is until the line of code shown above is erased or uncommented it. This leads me to assume that the issue is arising upon trying to access the file? I double checked that the file exists and that the pathway is right. Any ideas?

By the way, thanks for the input earlier, I glanced at several of the videos provided, but to no avail. :/