gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Patater's Introduction to Nintendo DS Programming > First Tutorial

#166491 - silverfang - Sun Feb 08, 2009 9:26 pm

I'm having trouble when compiling the first tutorial, I get errors where any other function is referenced.

it says 'functionName' was not declared in this scope

Where functionName is replaced with the name of the function...

Any help would be appreciated,

Cheers

#166495 - vuurrobin - Sun Feb 08, 2009 10:01 pm

did you put a function declaration before the main methodt?

something like this:

Code:

//the function declaration, so the compiler knows it exists.
void functionName(int a);


int main()
{
    //your program
    functionName(2);
    return 0;
}


void functionName(int a)
{
    //the functions code...
}




it could also be an spelling error...

#166496 - silverfang - Sun Feb 08, 2009 10:10 pm

vuurrobin wrote:
did you put a function declaration before the main methodt?

something like this:

Code:

//the function declaration, so the compiler knows it exists.
void functionName(int a);


int main()
{
    //your program
    functionName(2);
    return 0;
}


void functionName(int a)
{
    //the functions code...
}




it could also be an spelling error...


Thanks, didn't realise it was that simple...

I'm new to C++.

Thanks again.