Why Why Why????

Started by
9 comments, last by Drew_Benton 18 years, 6 months ago
Hey, I am making my own Pong Clone in C++ using SDL. Well, I don't think the problem is any of those, as the problem is a build error. It is weird. I can do almost ANY SDL program, but when it ALWAYS comes around to me programming my Pong Clone, it ALWAYS gives me a build error. It is weird. Here is the error I get...... C:\Dev-Cpp\Paddle_Ball\Makefile.win [Build Error] [Pong_Clone.exe] Error 1 That is the only error I get, and that is all of it. I am using Dev-CPP. What is up? What is causing this? Why? What should I do? Can someone PLEASE help? Ever since I have started using Dev-CPP with SDL, I have had some trouble with some stuff. I am SERIOUSLY thinking about switching to a different compiler. Like Microsoft Visual. lol. So, can anyone help? Chad.
Advertisement
Could you post your source code and maybe compiler options?
Are you linking with -mingw32 -lsdlmain -lsdl in that order? Did you create a project and add a file to it to compile? Just a few things to check off the bat.

OTOH, I'd suggest using Visual Studio if possible [wink]
THis is what I link with:

-lmingw32 -lSDLmain -lSDL

Try it out.
1st Post:Yeah I will post my source here. What you mean excatly by "Compiler Options?"

2nd Post:I am linking everything that I do on other projects(like practing loading images onto the screen and stuff like that.)Those compile fine. I link EVERYTHING like I did with those, cause I copied and pasted them. So that couldn't be it. I should get Linker Error too, if I didn't right? That is the ONLY error I get.



source:

#include <SDL/SDL.h>const int WINDOW_WIDTH=800;const int WINDOW_HEIGHT=600;const char* WINDOW_TITLE="Paddle Ball";void Init(){     SDL_Init( SDL_INIT_VIDEO );   SDL_Surface* screen = SDL_SetVideoMode( WINDOW_WIDTH, WINDOW_HEIGHT, 0,       SDL_HWSURFACE | SDL_DOUBLEBUF );   SDL_WM_SetCaption( WINDOW_TITLE, 0 );    SDL_Event event;   bool gameRunning = true;   while (gameRunning)   {      if (SDL_PollEvent(&event))      {         if (event.type == SDL_QUIT)         {            gameRunning = false;         }      }    }   SDL_Quit();    }int main(int argc, char **argv){     Init();     return 0;}


This is beging saved to the .dev which is called...Paddle_Ball, and I am saving all of it into a folder called...Paddle_Ball. I have SDL.dll is that folder also. The same place as the .exe should be going into.

What up?



PS:THANKS FOR FAST REPLY! HOPE TO GET THAT WITH THIS POST ALSO!
This is a far shot, but if you're using windows xp, make sure the program you are trying to compile is not in memory still (ctrl, alt, delete). This once happened to me- something got messed up and the program was still being run, though it wasnt in the task bar.

Edit: Yeah, I could successfully compile it on my computer. See if the above does not help. I have a few more ideas.
Quote:Original post by ender7771
Edit: Yeah, I could successfully compile it on my computer.


Same here! And since he handeled the SDL_QUIT, it should not reside in memory if it's closed, unless the console window was closed first maybe. Good hting you have more ideas, I'm out [wink]
I'm sorry, but I didn't understand that. What would that have to do with the project not compiling? The project WON'T compile period, so I can't even run the program. So maybe you meant something else or something?


Chad.
What I meant was that it compiled once, and then I ran it, and there was some serious leakage, and it wouldnt let me compile again.

But seeing how this is not the problem....

Can you get anything at all SDL related to compile in DevC++?

Double check to make sure your linking options (-lmingw32 -lSDLmain -lSDL) are correct. I know I sound like an idiot, but just do it. Be sure that you have SDL libs in all the right places.
Ok,
I will check both of those out.


OMG! It seems like when I went to copy and paste one of the linkers, I didn't do it all. I left out the little -. I added that in now, and it compiled perfectly. lol. Maybe I should double check to make sure I have everything! Thanks for ordering me to check that. lol(I am just playing, you didn't order me.) Atleast I can now continue coding. lol. Pong Clone MIGHT be done tommorow.


Chad.

This topic is closed to new replies.

Advertisement