Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build on Windows? #10

Open
yektasarioglu opened this issue Aug 3, 2019 · 3 comments
Open

How to build on Windows? #10

yektasarioglu opened this issue Aug 3, 2019 · 3 comments

Comments

@yektasarioglu
Copy link

I was trying to run makefile and I got an error that says;

gcc -std=c99 -Wall -Wextra -pedantic -Ofast -flto -march=native -lm -lSDL2 main.c -o littlewolf
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:12: all] Error 1

Any help would be appreciated. Thanks.

@servusdei2018

This comment was marked as outdated.

@xparq
Copy link

xparq commented Aug 21, 2019

@yektasarioglu: Add -lSDL2main to the command line, that's where WinMain lives in this setup.

@AdfalomnLaeninfus
Copy link

AdfalomnLaeninfus commented Nov 5, 2023

Include the definition of

#define SDL_MAIN_HANDLED

before importing the SDL library

image

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

No branches or pull requests

4 participants