ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Okay, I've been working with SDL, trying to figure out if I can get something to work out of it rather than an empty window. So I went to libsdl.org and found a tutorial, blah blah blah..... Now I went through the program using the tutorial, learning and trying what's going on step by step. (actually, two tutorials that sort of seamed into one) Anyways, at the last part the program setup two 'for' loops that would draw pixels, move them around, and change their colors as they went. Unfortuntaely I get this weird error:
'for' loop initial declaration used outside C99 mode
The problem lies in the DrawScene Function. It comes up for both 'for's (one for x one for y). I'm running Appbuilder in MacOSX and the only difference from it running and it not is this little loop right here. Thanks ahead for any help.
--------- Source Code Posted Below, Copied from Cone3D Programming -------
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
void Slock(SDL_Surface *screen)
{
if ( SDL_MUSTLOCK(screen) )
{
if ( SDL_LockSurface(screen) < 0 )
{
return;
}
}
}
Do you know how to do that in any other IDEs? App Builder/Project Builder uses the PPC OS-X port of GCC so I don't know why it would be trying to compile it in c99 form anyways. Thanks though.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.