Page 1 of 2
Don't you hate being a n00b?
Posted: Fri Mar 04, 2005 8:16 pm
by DJ Yoshi
Alright, so I'm trying to learn SDL via a book our friend GyroVorbis loaned to me, and I'm having a problem witht he second program, which is supposed to initialize a program that shows a blank screen.
Code: Select all
#include "sdl.h"
#include<stdio.h>
#include<stdlib.h>
SDL_Surface* g_pMainSurface = NULL;
SDL_Event g_Event;
int main(int argc, char *argv[])
{
if(SDL_Init(SDL_INIT_VIDEO)==-1)
{
fprintf(stderr,"Could not initialize SDL!\n");
exit(1);
}
else
{
fprintf(stdout,"SDL initialized properly!\n");
atexit(SDL_Quit);
}
g_pMainSurface = SDL_SetVideoMode(640,480,0,SDL_ANYFORMAT);
if(!g_pMainSurface)
{
fprintf(stderr,"Could not create main surface!\n");
exit(1);
}
for(;;)
{
if(SDL_WaitEvent(&g_Event)==0)
{
fprintf(stderr,"Error while waiting for an event!\n");
exit(1);
}
//check the type of event
if(g_Event.type==SDL_QUIT)
{
fprintf(stdout,"Quit event has occurred.\n");
break;
}
}
fprintf(stdout,"Terminating program normally.\n");
return(0);
}
Keeps giving me an "error executing links.exe". Any ideas why?
Thanks.
Visual C++ 6.0, by the way
Posted: Fri Mar 04, 2005 8:39 pm
by Falco Girgis
Have you gotten anything else to compile? I can look more in-depth at it, but it seems like the compiler would have alot more to bitch about if it were a real problem.
You said this was example 2 or something. Did the first one or any other example compile correctly?
Posted: Fri Mar 04, 2005 9:14 pm
by DJ Yoshi
The first one compiled fine...this one won't though.
:\
Posted: Sat Mar 05, 2005 7:45 pm
by JS Lemming
Its probably the fact that your using a subpar compiler.
Posted: Sat Mar 05, 2005 8:02 pm
by Falco Girgis
JS Lemming wrote:Its probably the fact that your using a subpar compiler.
Errr... excuse me? Whose the one that is using FREE dev C++? Just admit that you only hate VC++ because you don't have enough money to get it or have the resources to warez it.
Oh, and last I checked you were forced to dev on DC with VC++ because your other compiler is subpar.
PWNT! :spin:
Posted: Sat Mar 05, 2005 8:10 pm
by JS Lemming
GyroVorbis wrote:JS Lemming wrote:Its probably the fact that your using a subpar compiler.
Errr... excuse me? Whose the one that is using FREE dev C++? Just admit that you only hate VC++ because you don't have enough money to get it or have the resources to warez it.
Oh, and last I checked you were forced to dev on DC with VC++ because your other compiler is subpar.
PWNT! :spin:
You wish you pwnt me! The fact the DevC++ is free and OPEN SOURCE means that a bunch of cool guru foos are makeing some friggen sweet software. I can't help the fact that the guy who made the DC developement kit preferred VC++. Given the chance, I'd pick DevC++ over VC++ anyday!
Posted: Sun Mar 06, 2005 6:55 am
by DJ Yoshi
VC++ is a more powerful compiler ANY day of the week. Its tabbing system is about 100x better, its error messages are easier to read and more detailed, and its workspace is undeniably clean and easy to navigate.
Dev isn't BAD...but it's not as powerful by any means.
All the professionals use VC++. There's a reason
But anyways, BACK TO THE PROBLEM AT HAND:
I've gotten it to compile...sorta. Now it spits out this error message:
Code: Select all
dl1.obj : error LNK2005: _SDL_main already defined in ein.obj
sdl1.obj : error LNK2005: "struct SDL_Surface * g_pMainSurface" (?g_pMainSurface@@3PAUSDL_Surface@@A) already defined in ein.obj
sdl1.obj : error LNK2005: "union SDL_Event g_Event" (?g_Event@@3TSDL_Event@@A) already defined in ein.obj
Posted: Mon Mar 07, 2005 3:33 pm
by JS Lemming
BWWUHAHAHA!!! You call that an easier to read error message!?!?! FOOL!.
You guys will wish you had thought otherwise when Bill Gates buys out Wall Mart and increases the price of toilet paper ten fold!!!!
Corn cob anyone?
Posted: Mon Mar 07, 2005 3:46 pm
by Falco Girgis
JS Lemming wrote:BWWUHAHAHA!!! You call that an easier to read error message!?!?! FOOL!.
You guys will wish you had thought otherwise when Bill Gates buys out Wall Mart and increases the price of toilet paper ten fold!!!!
Corn cob anyone?
I wouldn't say that. More than once I've found DevC++ errors to be more than useless. VC++ has WAAAAY better error descriptions.
Posted: Mon Mar 07, 2005 5:46 pm
by Falco Girgis
Could it possibly be that you have multiple source files in the same project file? That'd be my first guess.
Posted: Tue Mar 08, 2005 7:27 am
by JS Lemming
GyroVorbis wrote:
I wouldn't say that. More than once I've found DevC++ errors to be more than useless. VC++ has WAAAAY better error descriptions.
Believe whatever you want, its not like your wasting my time trying to figure out random messages.
Posted: Tue Mar 08, 2005 11:14 am
by Falco Girgis
JS Lemming wrote:GyroVorbis wrote:
I wouldn't say that. More than once I've found DevC++ errors to be more than useless. VC++ has WAAAAY better error descriptions.
Believe whatever you want, its not like your wasting my time trying to figure out random messages.
I'm busy believing that. Oh, and you're the one wasting your own time trying to figure out DevC++ error messages...
Posted: Tue Mar 08, 2005 3:54 pm
by JS Lemming
You would be right if that were the case, but no, DevC++ error messages are comprehensive and too the point, and are actually readable.... matter'o'fact, I heard someone was going to make a book just out of the error messages, they are just that good.
Posted: Tue Mar 08, 2005 4:23 pm
by Falco Girgis
Hah, more like somebody is going to make a book on how to comprehend those terrible error messages.
Yes, they are that bad.
Posted: Tue Mar 08, 2005 4:33 pm
by quarn
You guys seem to confuse the compilers with the IDEs.
Also, the visual c++ toolkit 2003 (the core components, like the acctual compiler) is available for free at
http://msdn.microsoft.com/visualc/vctoolkit2003/
and the Visual C++ 2005 Express Beta suite at
http://lab.msdn.microsoft.com/express/v ... fault.aspx