Error with mingw32

When I tried to compile the following project, I got this error:

mingw32-g++.exe: obj\Debug\CApp.o: No such file or directory

Can someone explain me why?

Project files:
- CApp.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
#ifndef _CAPP_H_
    #define _CAPP_H_

#include <SDL.h>

class CApp {
    private:
        bool            Running;

        SDL_Surface*    Surf_Display;

    public:
        CApp();

        int OnExecute();

    public:

        bool OnInit();

        void OnEvent(SDL_Event* Event);

        void OnLoop();

        void OnRender();

        void OnCleanup() {
            SDL_FreeSurface(Surf_Display);
            SDL_Quit;
            }
};

#endif 


- CApp.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
#include "CApp.h"

CApp::CApp() {
    Surf_Display = NULL;
    Running = true;
}

int CApp::OnExecute() {
    if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
        return false;
        }

    if ((Surf_Display = SDL_SetVideoMode(640, 480, 32, SDL_HWSURFACE | SDL_DOUBLEBUF)) == NULL) {
        return false;
    }

    if (OnInit() == false){
        return -1;
    }

    SDL_Event Event;

    while(Running) {
        while(SDL_PollEvent(&Event)) {
            OnEvent(&Event);
            }

            OnLoop ();
            OnRender ();

        }

        OnCleanup ();

    return 0;
}

int main(int argc, char* argv[]) {
    CApp theApp;

    return theApp.OnExecute();
}


- CApp_OnInit.cpp
1
2
3
4
5
#include "CApp.h"

bool CApp::OnInit() {
    return true;
}


- CApp_OnEvent.cpp
1
2
3
4
5
6
7
#include "CApp.h"

void CApp::OnEvent(SDL_Event* Event) {
    if (Event -> type == SDL_QUIT) {
        Running = false;
        }
}


- CApp_OnLoop.cpp
1
2
3
4
#include "CApp.h"

void CApp::OnLoop() {
}


- CApp_OnRender.cpp
1
2
3
4
#include "CApp.h"

void CApp::OnRender() {
}


- CApp_OnCleanup.cpp
1
2
3
4
#include "CApp.h"

void CApp::OnCleanup() {
}


Also, I got this code from here:http://www.sdltutorials.com/sdl-tutorial-basics/
Is the sdl library configured properly?

I believe that you have to put your include definition in quotes instead of brackets because it is not part of the standard library.

To set up your ide correctly look here:
http://lazyfoo.net/SDL_tutorials/lesson01/index.php
(Click your OS, and then on your IDE)

This site has a really good SDL tutorial selection:
http://lazyfoo.net/SDL_tutorials/index.php
Last edited on
See if there are spaces in the path to CApp.o. If there are, configure your environment to add quotes around paths. You may also want to force it to use forward slashes rather than backslashes.
Still not work >.<

And how I do it, helios (I'm using CodeBlocks and Windows XP)?
Last edited on
Bump. >< Sorry!
Look at my post above and do it that way. It's self explanatory. Don't worry about messing around with extra classes now.
Last edited on
I believe that you have to put your include definition in quotes instead of brackets because it is not part of the standard library.
Boy, you suck.

Quotes in includes are used when the file you want to include can be found in a path relative to the file that does the inclusion. <> are used to make the compiler search for the file in its inclusion directories.

And how I do it, helios (I'm using CodeBlocks and Windows XP)?
Sorry. RTFM.
Topic archived. No new replies allowed.