How to link GLFW and glad with w64devkit

I spended too much time for linking GLFW and glad with w64devkit. I always getting errors like “undefined reference to Winmain” and other errors. I readed all documentation from the website and, I watched tutorials on YouTube and tryed to found information from other internet resources, but it still doesn’t work.

My project structure looks like this:
project
…include
…GLFW
…glfw3.h
…glfw3native.h
…glad
…glad.h
…KHR
…khrplatform.h
…lib
…libglfw3.a
…glad.c
…main.c
…Makefile

My Makefile looks like this:
app.exe : glad.o main.o
gcc glad.o main.o -lgdi32 -I include lib\libglfw3.a -o app.exe
glad.o : glad.c
gcc -c glad.c -lgdi32 -I include lib\libglfw3.a -o glad.o
main.o : main.c
gcc -c main.c -lgdi32 -I include lib\libglfw3.a -o main.o
clear :
rm *.o app.exe

I tryed to switch w64devkit on Cygwin, Winlibs, MSYS2, TDM-GCC, but it still doesn’t work.

Sorry my english can be bad(I writed this topic without translator)
Im newbie on GLFW forums

Thanks in advance for help

On Windows application can be “console” or “gui” depending on whether you want stdout/in connected to terminal by default or not. In gcc default application type is gui, thus it requires “WinMain” as entry point. “main” is used for console type applications. Either change entry point from “WinMain” to “main”, or change application to console with -mconsole argument if you want “main” entry point. All of this has nothing top do with glfw, that’s just how building C code for windows works.