This is a command line im using to create glfw.so shared library
gcc -D _GLFW_WIN32 -D _GLFW_BUILD_DLL -c win32_init.c win32_joystick.c win32_monitor.c win32_monitor.c win32_thread.c win32_time.c win32_window.c
And
gcc -shared -o glfw.so win32_thread.o win32_monitor.o win32_window.o win32_time.o win32_joystick.o win32_init.o
But im constantly getting these errors :
win32_monitor.o:win32_monitor.c:(.text+0x172): undefined reference to `__imp_CreateDCW'
win32_monitor.o:win32_monitor.c:(.text+0x1aa): undefined reference to `__imp_GetDeviceCaps'
win32_monitor.o:win32_monitor.c:(.text+0x1c8): undefined reference to `__imp_GetDeviceCaps'
win32_monitor.o:win32_monitor.c:(.text+0x220): undefined reference to `__imp_GetDeviceCaps'
win32_monitor.o:win32_monitor.c:(.text+0x285): undefined reference to `__imp_GetDeviceCaps'
win32_monitor.o:win32_monitor.c:(.text+0x2ad): undefined reference to `__imp_DeleteDC'
win32_monitor.o:win32_monitor.c:(.text+0x2cd): undefined reference to `_glfwAllocMonitor'
win32_monitor.o:win32_monitor.c:(.text+0x6f1): undefined reference to `_glfwInputMonitor'
win32_monitor.o:win32_monitor.c:(.text+0x826): undefined reference to `_glfwInputMonitor'
win32_monitor.o:win32_monitor.c:(.text+0x897): undefined reference to `_glfwInputMonitor'
win32_monitor.o:win32_monitor.c:(.text+0x8f9): undefined reference to `_glfwChooseVideoMode'
win32_monitor.o:win32_monitor.c:(.text+0x92c): undefined reference to `_glfwCompareVideoModes'
win32_monitor.o:win32_monitor.c:(.text+0xaeb): undefined reference to `_glfwInputError'
win32_monitor.o:win32_monitor.c:(.text+0xbd1): undefined reference to `__imp_GetDeviceCaps'
win32_monitor.o:win32_monitor.c:(.text+0xbe9): undefined reference to `__imp_GetDeviceCaps'
win32_monitor.o:win32_monitor.c:(.text+0xf33): undefined reference to `_glfwSplitBPP'
win32_monitor.o:win32_monitor.c:(.text+0xf72): undefined reference to `_glfwCompareVideoModes'
win32_monitor.o:win32_monitor.c:(.text+0x11ba): undefined reference to `_glfwSplitBPP'
win32_monitor.o:win32_monitor.c:(.text+0x120c): undefined reference to `__imp_CreateDCW'
win32_monitor.o:win32_monitor.c:(.text+0x122a): undefined reference to `__imp_GetDeviceGammaRamp'
win32_monitor.o:win32_monitor.c:(.text+0x123d): undefined reference to `__imp_DeleteDC'
win32_monitor.o:win32_monitor.c:(.text+0x1253): undefined reference to `_glfwAllocGammaArrays'
win32_monitor.o:win32_monitor.c:(.text+0x1305): undefined reference to `_glfwInputError'
win32_monitor.o:win32_monitor.c:(.text+0x1396): undefined reference to `__imp_CreateDCW'
win32_monitor.o:win32_monitor.c:(.text+0x13b4): undefined reference to `__imp_SetDeviceGammaRamp'
win32_monitor.o:win32_monitor.c:(.text+0x13c7): undefined reference to `__imp_DeleteDC'
win32_monitor.o:win32_monitor.c:(.text+0x1403): undefined reference to `_glfwInputError'
win32_monitor.o:win32_monitor.c:(.text+0x144a): undefined reference to `_glfwInputError'
win32_monitor.o:win32_monitor.c:(.rdata$.refptr._glfw[.refptr._glfw]+0x0): undefined reference to `_glfw'
win32_window.o:win32_window.c:(.text+0x237): undefined reference to `__imp_CreateDIBSection'
win32_window.o:win32_window.c:(.text+0x2a5): undefined reference to `__imp_CreateBitmap'
win32_window.o:win32_window.c:(.text+0x2d1): undefined reference to `__imp_DeleteObject'
win32_window.o:win32_window.c:(.text+0x3d9): undefined reference to `__imp_DeleteObject'
win32_window.o:win32_window.c:(.text+0x3e9): undefined reference to `__imp_DeleteObject'
win32_window.o:win32_window.c:(.text+0x893): undefined reference to `_glfwCenterCursorInContentArea'
win32_window.o:win32_window.c:(.text+0xbfa): undefined reference to `__imp_CreateRectRgn'
win32_window.o:win32_window.c:(.text+0xcd3): undefined reference to `__imp_DeleteObject'
win32_window.o:win32_window.c:(.text+0xf9e): undefined reference to `_glfwInputMonitorWindow'
win32_window.o:win32_window.c:(.text+0x105a): undefined reference to `_glfwInputMonitorWindow'
win32_window.o:win32_window.c:(.text+0x15ae): undefined reference to `_glfwInputWindowFocus'
win32_window.o:win32_window.c:(.text+0x164e): undefined reference to `_glfwInputWindowFocus'
win32_window.o:win32_window.c:(.text+0x16ba): undefined reference to `_glfwInputWindowCloseRequest'
win32_window.o:win32_window.c:(.text+0x1732): undefined reference to `_glfwInputChar'
win32_window.o:win32_window.c:(.text+0x18e9): undefined reference to `_glfwInputKey'
win32_window.o:win32_window.c:(.text+0x191a): undefined reference to `_glfwInputKey'
win32_window.o:win32_window.c:(.text+0x1955): undefined reference to `_glfwInputKey'
win32_window.o:win32_window.c:(.text+0x1981): undefined reference to `_glfwInputKey'
win32_window.o:win32_window.c:(.text+0x19b3): undefined reference to `_glfwInputKey'
win32_window.o:win32_window.c:(.text+0x1b0a): undefined reference to `_glfwInputMouseClick'
win32_window.o:win32_window.c:(.text+0x1c1c): undefined reference to `_glfwInputCursorEnter'
win32_window.o:win32_window.c:(.text+0x1ce8): undefined reference to `_glfwInputCursorPos'
win32_window.o:win32_window.c:(.text+0x1d11): undefined reference to `_glfwInputCursorPos'
win32_window.o:win32_window.c:(.text+0x1e7d): undefined reference to `_glfwInputError'
win32_window.o:win32_window.c:(.text+0x1f5d): undefined reference to `_glfwInputCursorPos'
win32_window.o:win32_window.c:(.text+0x1fcc): undefined reference to `_glfwInputCursorEnter'
win32_window.o:win32_window.c:(.text+0x2009): undefined reference to `_glfwInputScroll'
win32_window.o:win32_window.c:(.text+0x2052): undefined reference to `_glfwInputScroll'
win32_window.o:win32_window.c:(.text+0x2173): undefined reference to `_glfwInputWindowIconify'
win32_window.o:win32_window.c:(.text+0x219d): undefined reference to `_glfwInputWindowMaximize'
win32_window.o:win32_window.c:(.text+0x21c6): undefined reference to `_glfwInputFramebufferSize'
win32_window.o:win32_window.c:(.text+0x21ef): undefined reference to `_glfwInputWindowSize'
win32_window.o:win32_window.c:(.text+0x22c9): undefined reference to `_glfwInputWindowPos'
win32_window.o:win32_window.c:(.text+0x2547): undefined reference to `_glfwInputWindowDamage'
win32_window.o:win32_window.c:(.text+0x27e8): undefined reference to `_glfwInputWindowContentScale'
win32_window.o:win32_window.c:(.text+0x2895): undefined reference to `_glfwInputCursorPos'
win32_window.o:win32_window.c:(.text+0x296a): undefined reference to `_glfwInputDrop'
win32_window.o:win32_window.c:(.text+0x3082): undefined reference to `_glfwInitWGL'
win32_window.o:win32_window.c:(.text+0x30a7): undefined reference to `_glfwCreateContextWGL'
win32_window.o:win32_window.c:(.text+0x30cc): undefined reference to `_glfwInitEGL'
win32_window.o:win32_window.c:(.text+0x30f1): undefined reference to `_glfwCreateContextEGL'
win32_window.o:win32_window.c:(.text+0x310f): undefined reference to `_glfwInitOSMesa'
win32_window.o:win32_window.c:(.text+0x3131): undefined reference to `_glfwCreateContextOSMesa'
win32_window.o:win32_window.c:(.text+0x3e08): undefined reference to `_glfwInputWindowMonitor'
win32_window.o:win32_window.c:(.text+0x44ce): undefined reference to `_glfwInputWindowCloseRequest'
win32_window.o:win32_window.c:(.text+0x464c): undefined reference to `_glfwInputKey'
win32_window.o:win32_window.c:(.text+0x4953): undefined reference to `_glfwInputError'
win32_window.o:win32_window.c:(.text+0x4e98): undefined reference to `_glfwInputError'
win32_window.o:win32_window.c:(.text+0x4f01): undefined reference to `_glfwInputError'
win32_window.o:win32_window.c:(.text+0x4f7d): undefined reference to `_glfwGetVulkanResultString'
win32_window.o:win32_window.c:(.text+0x4f91): undefined reference to `_glfwInputError'
win32_window.o:win32_window.c:(.text+0x4fca): undefined reference to `_glfwInputError'
win32_joystick.o:win32_joystick.c:(.text+0x3af): undefined reference to `_glfwFreeJoystick'
win32_joystick.o:win32_joystick.c:(.text+0x3bd): undefined reference to `_glfwInputJoystick'
win32_joystick.o:win32_joystick.c:(.text+0x80a): undefined reference to `_glfwInputError'
win32_joystick.o:win32_joystick.c:(.text+0x847): undefined reference to `_glfwInputError'
win32_joystick.o:win32_joystick.c:(.text+0x8c6): undefined reference to `_glfwInputError'
win32_joystick.o:win32_joystick.c:(.text+0x967): undefined reference to `_glfwInputError'
win32_joystick.o:win32_joystick.c:(.text+0xa28): undefined reference to `_glfwInputError'
win32_joystick.o:win32_joystick.c:(.text+0xade): more undefined references to `_glfwInputError' follow
win32_joystick.o:win32_joystick.c:(.text+0xc62): undefined reference to `_glfwAllocJoystick'
win32_joystick.o:win32_joystick.c:(.text+0xd15): undefined reference to `_glfwInputJoystick'
win32_joystick.o:win32_joystick.c:(.text+0xda4): undefined reference to `_glfwInputError'
win32_joystick.o:win32_joystick.c:(.text+0xf59): undefined reference to `_glfwAllocJoystick'
win32_joystick.o:win32_joystick.c:(.text+0xf82): undefined reference to `_glfwInputJoystick'
win32_joystick.o:win32_joystick.c:(.text+0x1000): undefined reference to `_glfwInputError'
win32_joystick.o:win32_joystick.c:(.text+0x129f): undefined reference to `_glfwInputJoystickAxis'
win32_joystick.o:win32_joystick.c:(.text+0x12d3): undefined reference to `_glfwInputJoystickButton'
win32_joystick.o:win32_joystick.c:(.text+0x1370): undefined reference to `_glfwInputJoystickHat'
win32_joystick.o:win32_joystick.c:(.text+0x1475): undefined reference to `_glfwInputJoystickAxis'
win32_joystick.o:win32_joystick.c:(.text+0x14b5): undefined reference to `_glfwInputJoystickAxis'
win32_joystick.o:win32_joystick.c:(.text+0x14ea): undefined reference to `_glfwInputJoystickAxis'
win32_joystick.o:win32_joystick.c:(.text+0x152a): undefined reference to `_glfwInputJoystickAxis'
win32_joystick.o:win32_joystick.c:(.text+0x1561): undefined reference to `_glfwInputJoystickAxis'
win32_joystick.o:win32_joystick.c:(.text+0x1598): more undefined references to `_glfwInputJoystickAxis' follow
win32_joystick.o:win32_joystick.c:(.text+0x15d2): undefined reference to `_glfwInputJoystickButton'
win32_joystick.o:win32_joystick.c:(.text+0x163e): undefined reference to `_glfwInputJoystickHat'
win32_init.o:win32_init.c:(.text+0x137a): undefined reference to `_glfwInputError'
win32_init.o:win32_init.c:(.text+0x19ea): undefined reference to `_glfwTerminateWGL'
win32_init.o:win32_init.c:(.text+0x19ef): undefined reference to `_glfwTerminateEGL'
I've been following or better to say trying to follow steps from here.
Im trying to avoid using CMAKE and other shortcut programs to speed this process.