Trying bare minimum SDL2 example
Posted: Wed Mar 13, 2024 9:08 pm
Hello, trying a SDL2 bm example for GC and getting this error:
any clue ?
thanks in advance
Main.cpp
linking ... red.elf
C:/devkitPro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/bin/ld.exe: C:/devkitPro/devkitPPC/bin/../lib/gcc/powerpc-eabi/13.2.0/../../../../powerpc-eabi/lib/crtmain.o: in function `__crtmain':
crtmain.c:(.text.__crtmain+0x3c): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
make[1]: *** [C:\devkitPro\devkitPPC/gamecube_rules:31: /c/projects/128-Bit/gamecube/red/red.elf] Error 1
make: *** [Makefile:102: build] Error 2
Code: Select all
#include <gccore.h>
#include <SDL2/sdl.h>
int main(void) {
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
SDL_Log("error: Failed to initialize");
return 1;
}
// Create a window
SDL_Window *window = SDL_CreateWindow("GameCube SDL2 Example", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN);
if (!window) {
SDL_Log("SDL_CreateWindow Error: %s\n", SDL_GetError());
SDL_Quit();
return 1;
}
// Main loop
SDL_Event event;
int quit = 0;
while (!quit) {
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
quit = 1;
}
}
}
// Cleanup
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
thanks in advance