SDL-Wii: undefined reference to main October 04, 2009 04:07PM | Admin Registered: 16 years ago Posts: 5,132 |
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.4.1/../../../../powerpc-eabi/lib/crtmain.o: In function `__crtmain': e:/devkitpro-svn/buildscripts/newlib-1.17.1/libgloss/rs6000/crtmain.c:18: undefined reference to `main' collect2: ld returned 1 exit status
Re: SDL-Wii: undefined reference to main October 04, 2009 09:37PM | Registered: 15 years ago Posts: 703 |
Re: SDL-Wii: undefined reference to main October 05, 2009 07:15AM | Registered: 16 years ago Posts: 265 |
Re: SDL-Wii: undefined reference to main October 09, 2009 10:57PM | Admin Registered: 16 years ago Posts: 5,132 |
Re: SDL-Wii: undefined reference to main October 17, 2009 07:59PM | Admin Registered: 16 years ago Posts: 5,132 |
Now that I'm actually using it, I can see the presence of this. For curiosity's sake, do you know what code is actually executed first then? When does my program reach to the point of executing the first line of code in my main() ?Quote
henke37
When using sdl, it hijacks the role as main, your main is silently renamed to something else.
Re: SDL-Wii: undefined reference to main October 17, 2009 10:09PM | Registered: 15 years ago Posts: 703 |
Quote
ArikadoNow that I'm actually using it, I can see the presence of this. For curiosity's sake, do you know what code is actually executed first then? When does my program reach to the point of executing the first line of code in my main() ?Quote
henke37
When using sdl, it hijacks the role as main, your main is silently renamed to something else.
/* Do initialisation which has to be done first for the console to work */ /* Entry point */ int main(int argc, char *argv[]) { #ifdef HW_RVL // Wii Power/Reset buttons WPAD_Init(); WPAD_SetPowerButtonCallback((WPADShutdownCallback)ShutdownCB); SYS_SetPowerCallback(ShutdownCB); SYS_SetResetCallback(ResetCB); #endif PAD_Init(); WII_InitVideoSystem(); #ifdef HW_RVL WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR); WPAD_SetVRes(WPAD_CHAN_ALL, 640, 480); MOUSE_Init(); KEYBOARD_Init(NULL); #endif /* Call the user's main function */ return(SDL_main(argc, argv)); }
Re: SDL-Wii: undefined reference to main November 05, 2009 10:07PM | Admin Registered: 16 years ago Posts: 5,132 |
Re: SDL-Wii: undefined reference to main November 05, 2009 10:51PM | Registered: 15 years ago Posts: 703 |
void WII_InitVideoSystem() { /* Initialise the video system */ VIDEO_Init(); vmode = VIDEO_GetPreferredMode(NULL); switch (vmode->viTVMode >> 2) { case VI_PAL: // 576 lines (PAL 50hz) // display should be centered vertically (borders) vmode = &TVPal574IntDfScale; vmode->xfbHeight = 480; vmode->viYOrigin = (VI_MAX_HEIGHT_PAL - 480)/2; vmode->viHeight = 480; break; case VI_NTSC: // 480 lines (NTSC 60hz) break; default: // 480 lines (PAL 60Hz) break; } /* Set up the video system with the chosen mode */ VIDEO_Configure(vmode); // Allocate the video buffers xfb[0] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (vmode)); xfb[1] = (u32 *) MEM_K0_TO_K1 (SYS_AllocateFramebuffer (vmode)); VIDEO_ClearFrameBuffer(vmode, xfb[0], COLOR_BLACK); VIDEO_ClearFrameBuffer(vmode, xfb[1], COLOR_BLACK); VIDEO_SetNextFramebuffer (xfb[0]); // Show the screen. VIDEO_SetBlack(FALSE); VIDEO_Flush(); VIDEO_WaitVSync(); if (vmode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync(); else while (VIDEO_GetNextField()) VIDEO_WaitVSync(); /*** Clear out FIFO area ***/ memset (&gp_fifo, 0, DEFAULT_FIFO_SIZE); /*** Initialise GX ***/ GX_Init (&gp_fifo, DEFAULT_FIFO_SIZE); GXColor background = { 0, 0, 0, 0xff }; GX_SetCopyClear (background, 0x00ffffff); SetupGX(); }
Re: SDL-Wii: undefined reference to main November 05, 2009 11:11PM | Admin Registered: 16 years ago Posts: 5,132 |
Re: SDL-Wii: undefined reference to main November 06, 2009 01:04AM | Registered: 15 years ago Posts: 7 |
Re: SDL-Wii: undefined reference to main November 06, 2009 01:35AM | Moderator Registered: 15 years ago Posts: 441 |
Re: SDL-Wii: undefined reference to main November 06, 2009 02:48AM | Admin Registered: 16 years ago Posts: 5,132 |
scanff and I had a discussion on IRC and I realize that now.Quote
Tantric
Setting up a console would be pointless as it's not visible with GX enabled.
Re: SDL-Wii: undefined reference to main November 06, 2009 04:36AM | Moderator Registered: 15 years ago Posts: 441 |
Re: SDL-Wii: undefined reference to main November 06, 2009 12:49PM | Admin Registered: 16 years ago Posts: 5,132 |