0

Hello. I'm going through LazyFoo.net's SDL tutorials and right off the bat I got stuck.
I am using Visual Basic and it is giving me an error saying that the identifier 'args[]' in the main function (line 5) is undefined. Anyone have a solution?

//Headers
#include "SDL.h"
#include <string>

int main( int argc, char*, args[])
{
    //The images
    SDL_Surface* hello = NULL;
    SDL_Surface* screen = NULL;

    //Start SDL
    SDL_Init(SDL_INIT_EVERYTHING);

    //Set up the screen
    screen = SDL_SetVideoMode(640, 480, 32, SDL_SWSURFACE);

    //Load image
    hello = SDL_LoadBMP("hello.bmp");

    //Apply image to screen
    SDL_BlitSurface(hello, NULL, screen, NULL);

    //Update Screen
    SDL_Flip(screen);

    //Pause
    SDL_Delay(2000);

    //Free the loaded image
    SDL_FreeSurface(hello);

    //Quit SDL
    SDL_Quit();

    return 0;
}
2
Contributors
1
Reply
20
Views
4 Years
Discussion Span
Last Post by phorce
2

Try the following:

int main( int argc, char* args[])

Instead of:

int main( int argc, char*, args[])

Hope this helps :)

Votes + Comments
nice
Yup.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.