My SDL program contains:
TTF_Init();
TTF_Font *font = TTF_OpenFont("segoeui.ttf",13);
SDL_Color textColor = {0,0,0};
SDL_Color backgroundColor = {34,177,76};
SDL_Surface *myText = TTF_RenderText_Shaded(font,"Some text",textColor,backgroundColor);
When I run the program from the Build and run button in Code::Blocks, there isn't any problem but when I run the program from the folder in Windows Explorer, the window opens and closes directly, and after the window closes, the process isn't running any more and the files stderr.txt and stdout.txt are still there. I've made some tests and found out that it's the line SDL_Surface *myText = TTF_RenderText_Shaded(font,"Some text",textColor,backgroundColor);
that seems to end the process just like that like if the End Process button would have been pressed in the task manager.
Why does it do that? How can I fix it?