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.

C/C++ > AHHHHHHHH

#11393 - IAMTHEEVILBEAN - Sat Oct 04, 2003 3:09 am

I finally got visual C++ and am having problems AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHh ok heres the code

Code:
// kuseytrte.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int main(int argc, char* argv[])
{
   printf("Hello World!\n");
   return 0;
}


simple is it not!??!?!?!?! I even clicked on the pre made console app and it doesnt work... it says 1 error but where i can find out what the error is is unknown to me
_________________
Moose

#11412 - DiscoStew - Sun Oct 05, 2003 5:23 pm

Correct me if I'm wrong, but isn't the main() function not supposed to have any parameters to pass? Take the parameters out, and try that. Just a thought since that is the entry point, but it will have no values to pass through.

Also, when using the printf() function, don't you need the
'#include <stdio.h>' line?
_________________
DS - It's all about DiscoStew

#11413 - Sean - Sun Oct 05, 2003 6:10 pm

The code posted is generated by VC++ for a Windows console application. This will not run on the gameboy advance. Are you trying to create a windows tool for gba development, or are you trying to create a gba rom?

#11419 - IAMTHEEVILBEAN - Mon Oct 06, 2003 1:00 am

HAH im just trying to learn C and i got it working fine with dev c++ which is good enough
_________________
Moose

#11867 - marcmccann - Wed Oct 22, 2003 2:31 pm

without trying to be funny or anything, if you are trying to learn C then why are you using compiler generated projects? Surely the only way to learn is to actually start these projects from scratch, then you will know how they work!!

the simplest way to make that project you have made is like this:-

Code:

#include <stdio.h>

void main() //We wont need to return(0) since we've voided main()
{
       printf("Hello World\n");
}


the compiler generated projects are designed to save time for professional programmers and not for newbies or starting out programmers.
_________________
The GBA is one Lean and Mean machine!