Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse SDL build error: "The program specified in the launch configuration does not exist"

Tags:

c++

eclipse

I've tried working some SDL on my set-up eclipse, and as I tried running it it gave me the following error:

  'Launching SDL.exe' has encountered a problem.
  The program specified in the launch configuration does not exist

I instantly went to another project to see if it builds, and it did. I also tried re-building, debugging the SDL project. I don't know if it's an error in code but just in case, this is the code:

#include "SDL/SDL.h"
#include <string>
#include <SDL/SDL_image.h>

SDL_Surface *load_image( std::string filename ) {
    SDL_Surface* loadedImage = NULL;
    SDL_Surface* optimizedImage = NULL;

    loadedImage = IMG_Load(filename.c_str());
    if(loadedImage != NULL) {
        optimizedImage = SDL_DisplayFormat(loadedImage);
        SDL_FreeSurface(loadedImage);
    }
    return optimizedImage;
}

I've googled it, and there's a duplicate question on stackOverFlow here, however it has 0 answers, not even a comment. There are no answers on google regarding this problem, so if you'd answer it, you'd probably solve hours of headaches for more people.

like image 395
Bugster Avatar asked Mar 07 '26 01:03

Bugster


1 Answers

I encountered the same problem with eclipse in Ubuntu. Spent 30 minutes and finally got it fixed as below:

  • Click Project -> Properties;
  • Select run/debug settings, and then the current configuration on the right pane, click edit;
  • In the c/c++ application textbox, select search project, and then click the binary you want to execute for the current project.

On my system, the previous problem is due to incorrect default file name --- the linker generates abinary.exe but in run configuration it is "abinary".

Such tiny (but time consuming) problems should have been fixed by Eclipse developers, if they got well paid as MS or apple developers. Alas, free software?

like image 92
Yan Huang Avatar answered Mar 08 '26 13:03

Yan Huang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!