The program file specified in the launch configuration does not exist

Hi guys sorry about asking so many questions this week I'm just getting back into the swing of things,setting up my IDE,getting comfortable with the language again,anyway

It seems that I my program won't compile I get this error

The program file specified in the launch configuration does not exist
C:\Users\User\workspaceforcpp\SDLTest\Debug\SDLTest.exe not found

but the strange thing is before I broke my code up into a more object orientated way by adding a header file and a file for screen,or in other words when I was running all the code from main it worked fine

I have also other projects with many header and cpp files and they compile just fine also

So this puzzles me as to why I am getting this error,it builds fine but no success,I have spent the last hour researching how to fix this problem and have found people with a similar problem to me but all the solutions didn't work,I tried rebuilding and cleaning the project,I also followed these steps from a user in a post I found

Right click on your project --> Properties
Run/Debug settings
Delete whatever is set as "launch configuration for '........'
Project --> Clean
Project --> Build Project

but to no avail,any suggestions?

I will post my code anyway even though as far as I know there is nothing wrong with my code

main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
  #include <iostream>
#include "Screen.h"


using namespace std;
using namespace amc;

int main(int argc, char* argv[])
{
    Screen screen;
    screen.init();
	bool quit = false;
	SDL_Event event;

	while(!quit){

		   while(SDL_PollEvent(&event)){

			   if(event.key.keysym.scancode == SDL_SCANCODE_5){

				   cout << "5 pressed" << endl;

			   }
	   		  if(event.type == SDL_QUIT){

	   			  quit = true;
	   		  }
	   	   }
	      }

	screen.close();
}

Screen.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56

#include <iostream>
#include "Screen.h"

using namespace std;

namespace amc{

  Screen:: Screen():
		window(NULL),renderer(NULL),texture(NULL),buffer(NULL)
  {

  }

  bool Screen:: init(){

	  if(SDL_Init(SDL_INIT_VIDEO) < 0){

	  	   return false;
	     }
	  window = SDL_CreateWindow("Particle eXplosion",SDL_WINDOWPOS_UNDEFINED,
	  		   SDL_WINDOWPOS_UNDEFINED,SCREEN_WIDTH,SCREEN_HEIGHT,SDL_WINDOW_SHOWN);
	  renderer = SDL_CreateRenderer(window,-1,SDL_RENDERER_PRESENTVSYNC);
	  texture = SDL_CreateTexture(renderer,SDL_PIXELFORMAT_RGBA8888,SDL_TEXTUREACCESS_STATIC,SCREEN_WIDTH,SCREEN_HEIGHT);
	  buffer = new Uint32[SCREEN_WIDTH * SCREEN_HEIGHT];

	  for(int i = 0; i < SCREEN_WIDTH * SCREEN_HEIGHT; i++){

	 	 		 buffer[i] = 0xFFFF00FF;
	 	 }

	  SDL_UpdateTexture(texture,NULL,buffer,SCREEN_WIDTH*sizeof(Uint32));
	  SDL_RenderClear(renderer);
	  SDL_RenderCopy(renderer,texture,NULL,NULL);
	  SDL_RenderPresent(renderer);
	  return true;
  }

  bool Screen:: processEvents(){

	  return false;
  }

   void Screen:: close(){


	   delete [] buffer;
	   SDL_DestroyRenderer(renderer);
	   SDL_DestroyTexture(texture);
	   SDL_Delay(9000);
	   SDL_DestroyWindow(window);
	   SDL_Quit();
   }

}


Screen.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39



#ifndef SCREEN_H_
#define SCREEN_H_
#include <SDL.h>

namespace amc{


class Screen{


private:
	SDL_Window *window;
	SDL_Renderer *renderer;
	SDL_Texture *texture;
	Uint32 *buffer;


public:
	const static int SCREEN_WIDTH;
    const static int SCREEN_HEIGHT;

public:

    Screen();
    bool init();
    bool processEvents();
    void close();


};

}

#endif /* SCREEN_H_ */



**edit my IDE is eclipse Luna
Last edited on
Hello adam2016,

This sounds much like a problem I have with Visual Studio form time to time. The solution I have to use is to manually find and delete the ".exe" file that was made and then rebuild the project solution.

I am not familiar with how eclipse Luna works, so I do not know where too tell you to look for the ".exe" file.

The only other thing I can think of is that not all your source and header files are set up to compile.

Maybe someone else has used eclipse Luna and has a better idea.

Hope that helps,

Andy
Hi Andy thanks for the reply much appreciated,

I tried deleting the .exe file and cleaning and building the project but now when I do it for the second time the .exe disappears from the debug and release folders,

the program works fine when I just include one cpp file with a main but it seems when I use it in classes it won't work

**edit it only seems not work when the files are separated for example my main code in Screen.cpp,declarations in Screen.h and main cpp file with main method

for example this code compiles and runs fine

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102


#include <SDL.h>
#include <iostream>

using namespace std;

int main(int argc, char* argv[]) {
    // Start SDL2

	const int SCREEN_WIDTH = 800;
	const int SCREEN_HEIGHT = 600;

   if(SDL_Init(SDL_INIT_VIDEO) < 0){

	   return 1;
   }

   SDL_Window *window = SDL_CreateWindow("Particle eXplosion",SDL_WINDOWPOS_UNDEFINED,
		   SDL_WINDOWPOS_UNDEFINED,SCREEN_WIDTH,SCREEN_HEIGHT,SDL_WINDOW_SHOWN);

   if(window == NULL){

	   cout << "window is null" << endl;
	   SDL_Quit();
       return 2;
   }

   SDL_Renderer *renderer = SDL_CreateRenderer(window,-1,SDL_RENDERER_PRESENTVSYNC);
   SDL_Texture *texture = SDL_CreateTexture(renderer,SDL_PIXELFORMAT_RGBA8888,SDL_TEXTUREACCESS_STATIC,SCREEN_WIDTH,SCREEN_HEIGHT);
   Uint32 *buffer = new Uint32[SCREEN_WIDTH * SCREEN_HEIGHT];

   bool quit = false;
   SDL_Event event;
   SDL_KeyboardEvent kEvent;

   memset(buffer,0xFF,SCREEN_WIDTH * SCREEN_HEIGHT * sizeof(Uint32));
   SDL_UpdateTexture(texture,NULL,buffer,SCREEN_WIDTH*sizeof(Uint32));
   SDL_RenderClear(renderer);
   SDL_RenderCopy(renderer,texture,NULL,NULL);
   SDL_RenderPresent(renderer);
   bool pressed = false;

   while(!quit){


	   for(int i = 0; i < SCREEN_WIDTH * SCREEN_HEIGHT; i++){

		   buffer[i] = 0xFFFF00FF;
	   }

	      SDL_UpdateTexture(texture,NULL,buffer,SCREEN_WIDTH*sizeof(Uint32));
	      SDL_RenderClear(renderer);
	      SDL_RenderCopy(renderer,texture,NULL,NULL);
	      SDL_RenderPresent(renderer);

	     if(kEvent.type == SDL_KEYDOWN){


	    	 cout << "key down" << endl;
	     }


	       for(int i = 0; i < SCREEN_WIDTH * SCREEN_HEIGHT; i++){

	    	   if(i % 2 == 0) {
	    	       buffer[i] = 0xFFFFFFFF;
	    	   } else {
	    	       buffer[i] = 0xFF0000FF;
	    	   }
	       	   }
           pressed = false;


	        SDL_UpdateTexture(texture,NULL,buffer,SCREEN_WIDTH*sizeof(Uint32));
	        SDL_RenderClear(renderer);
	        SDL_RenderCopy(renderer,texture,NULL,NULL);
	        SDL_RenderPresent(renderer);

	   while(SDL_PollEvent(&event)){

		   if(event.key.keysym.scancode == SDL_SCANCODE_5 && !pressed){

			   cout << "5 pressed" << endl;
			   pressed = true;
		   }
   		  if(event.type == SDL_QUIT){

   			  quit = true;
   		  }
   	   }
      }
   delete [] buffer;
   SDL_DestroyRenderer(renderer);
   SDL_DestroyTexture(texture);
   SDL_Delay(9000);
   SDL_DestroyWindow(window);
   SDL_Quit();

	return 0;
}
Last edited on
Still have not found a solution =(
Topic archived. No new replies allowed.