Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Fix SDL2 demos main signature #928

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix SDL2 demos main signature #928

wants to merge 1 commit into from

Conversation

nsauzede
Copy link

@nsauzede nsauzede commented Oct 16, 2019

Current SDL2 nuklear demos fail to build on Windows (mingw64) :

nuklear/demo/sdl_opengl3$ make
rm -f bin/demo.exe
cc main.c -std=c99 -pedantic -O2 -o bin/demo.exe -lmingw32 -lSDL2main -lSDL2 -lopengl32 -lm -lGLU32 -lGLEW32
In file included from C:/msys64/mingw64/include/SDL2/SDL.h:32,
                 from main.c:14:
main.c:73:5: error: conflicting types for 'SDL_main'
   73 | int main(void)
      |     ^~~~
In file included from C:/msys64/mingw64/include/SDL2/SDL.h:32,
                 from main.c:14:
C:/msys64/mingw64/include/SDL2/SDL_main.h:121:29: note: previous declaration of 'SDL_main' was here
  121 | extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
      |                             ^~~~~~~~
make: *** [Makefile:25: demo.exe] Error 1

This trivial patch changes int main(void) into int main(int argc, char *argv[]) which is the correct C main() signature

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant