GLFW will not link to my project

I’m trying to compile glfw as a static lib during my premake build process, but when I link it to my project and try to call a function, I get of ton of linking errors (I think related to platforms). I’ve been banging my head at this for days. I wrote a premake5.lua file partially from resources online, and partially from the GLFW cmake file. I am using mingw64. I’ll post my errors and premake5 file.
I really appreciate any help.

Hi @UhGoomba,

Welcome to the GLFW forum.

Creating your own premake5 file is a bit tricky, especially as you will need to create a glfw_config.h file yourself or set up the required macros as described in the docs.

What I would do is run CMake to generate your build files, and then base your premake5 setup on that.

I don’t know premake5 but it looks like you are missing a number of required source files in the files section. If you look at the errors you can see the functions which are not included being listed. For example if you search for _glfwPlatformFreeModule you will find that it is defined in a number of files each of which has the name of the platform.

For instance _glfwPlatformFreeModule is defined in win32_module.c for the Windows platform which MinGW-w64 targets. You will need all the win32_* files in your premake5 file.

Is the win32 stuff not only for 64 bit? Am I misinterpreting this? I assumed the win32 variable in the cmake file was if you were using 32 bit or not

win32 just means Windows OS. it’s a common code abbreviation.