Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C 手动将GLFW编译为共享库_C_Powershell_Opengl_Gcc_Glfw - Fatal编程技术网

C 手动将GLFW编译为共享库

C 手动将GLFW编译为共享库,c,powershell,opengl,gcc,glfw,C,Powershell,Opengl,Gcc,Glfw,这是im用来创建glfw.so共享库的命令行 gcc-D_GLFW_WIN32-D_GLFW_BUILD_DLL-c WIN32_init.c WIN32_magnage.c WIN32_monitor.c WIN32_monitor.c WIN32_thread.c WIN32_time.c WIN32_window.c 及 gcc-shared-o glfw.so win32_thread.o win32_monitor.o win32_window.o win32_time.o win32

这是im用来创建glfw.so共享库的命令行

gcc-D_GLFW_WIN32-D_GLFW_BUILD_DLL-c WIN32_init.c WIN32_magnage.c WIN32_monitor.c WIN32_monitor.c WIN32_thread.c WIN32_time.c WIN32_window.c

gcc-shared-o glfw.so win32_thread.o win32_monitor.o win32_window.o win32_time.o win32_mongage.o win32_init.o

但我经常会犯这样的错误:

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'
我一直在遵循或更好地说,试图遵循的步骤


我试图避免使用CMAKE和其他快捷程序来加速这个过程。

你到底为什么要标记powershell?我在powershell中这样做,所以我认为这可能会有所帮助。函数名让我想起了
gdi32.dll
。你最好看看这里: