How to compile programs involving external libraries using MSVC developer command prompt? - c++

I am working on an opengl project (in Visual Studio 2019) in which I am using glfw and glad. I want to create a makefile (windows platform) so that other team members could also compile and execute it. I am using nmake command on the developer command prompt to run the makefile. The problem is I don't know how to link programs involving an external library (like glfw). I tried to specify the library path like:
link /nologo /LIBPATH:"files\libs" main.obj sphere.obj
This gives errors like "unresolved external symbols [glfw functions ex:glfwinit(),etc]". Specifying the library glfw3.lib with the .obj files like:
link /nologo /LIBPATH:"files\libs" main.obj sphere.obj glfw3.lib
again gives a list of errors specifying many unresolved external symbols and asks to use /NODEFAULTLIB which doesn't work either.
So how am I supposed to link these programs?
EDIT:
Also: I have 64 bit glfw3.lib . I used both the developer command prompt and the x64 native tools command prompt. With the developer command prompt I got an error:
LIBCMT.lib(std_type_info_static.obj) : fatal error LNK1112: module machine type 'x86' conflicts with target machine type 'x64'
So I used x64 native tools command prompt. The following errors are the errors I got using x64 native tools command prompt.
On specifying glfw3.lib along with the .obj files, I am getting these errors:
link /nologo /LIBPATH:"..\SoC Other Files" glad.obj Planet.obj ImageLoader.obj Shader.obj Sphere.obj glfw3.lib
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4286: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(win32_joystick.obj)'
LINK : warning LNK4286: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(wgl_context.obj)'
LINK : warning LNK4286: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(egl_context.obj)'
LINK : warning LNK4286: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(osmesa_context.obj)'
LINK : warning LNK4286: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(win32_monitor.obj)'
LINK : warning LNK4286: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(monitor.obj)'
LINK : warning LNK4286: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(vulkan.obj)'
LINK : warning LNK4286: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(win32_window.obj)'
LINK : warning LNK4217: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(init.obj)' in function '_glfwInputError'
LINK : warning LNK4217: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(window.obj)' in function 'glfwSetWindowAttrib'
LINK : warning LNK4217: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(input.obj)' in function 'glfwGetGamepadState'
LINK : warning LNK4286: symbol 'calloc' defined in 'libucrt.lib(calloc.obj)' is imported by 'glfw3.lib(win32_init.obj)'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(win32_joystick.obj)'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(wgl_context.obj)'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(egl_context.obj)'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(osmesa_context.obj)'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(win32_monitor.obj)'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(monitor.obj)'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(vulkan.obj)'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(win32_window.obj)'
LINK : warning LNK4217: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(init.obj)' in function 'terminate'
LINK : warning LNK4217: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(window.obj)' in function 'glfwSetWindowAttrib'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(input.obj)'
LINK : warning LNK4286: symbol 'free' defined in 'libucrt.lib(free.obj)' is imported by 'glfw3.lib(win32_init.obj)'
LINK : warning LNK4217: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'glfw3.lib(init.obj)' in function 'vsnprintf'
LINK : warning LNK4286: symbol '__stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'glfw3.lib(win32_joystick.obj)'
LINK : warning LNK4217: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'glfw3.lib(osmesa_context.obj)' in function '_glfwCreateContextOSMesa'
LINK : warning LNK4286: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'glfw3.lib(monitor.obj)'
LINK : warning LNK4217: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'glfw3.lib(vulkan.obj)' in function '_glfwGetVulkanResultString'
LINK : warning LNK4217: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'glfw3.lib(wgl_context.obj)' in function 'choosePixelFormat'
LINK : warning LNK4286: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'glfw3.lib(egl_context.obj)'
LINK : warning LNK4217: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'glfw3.lib(window.obj)' in function 'glfwWindowHintString'
LINK : warning LNK4286: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'glfw3.lib(input.obj)'
LINK : warning LNK4286: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'glfw3.lib(context.obj)'
LINK : warning LNK4286: symbol '_wassert' defined in 'libucrt.lib(assert.obj)' is imported by 'glfw3.lib(win32_thread.obj)'
LINK : warning LNK4217: symbol 'strcspn' defined in 'libucrt.lib(strcspn.obj)' is imported by 'glfw3.lib(input.obj)' in function 'glfwUpdateGamepadMappings'
LINK : warning LNK4217: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'glfw3.lib(input.obj)' in function 'parseMapping'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'glfw3.lib(context.obj)'
LINK : warning LNK4286: symbol 'strncmp' defined in 'libucrt.lib(strncmp.obj)' is imported by 'glfw3.lib(egl_context.obj)'
LINK : warning LNK4217: symbol 'realloc' defined in 'libucrt.lib(realloc.obj)' is imported by 'glfw3.lib(input.obj)' in function 'glfwUpdateGamepadMappings'
LINK : warning LNK4286: symbol 'realloc' defined in 'libucrt.lib(realloc.obj)' is imported by 'glfw3.lib(win32_monitor.obj)'
LINK : warning LNK4286: symbol 'realloc' defined in 'libucrt.lib(realloc.obj)' is imported by 'glfw3.lib(monitor.obj)'
LINK : warning LNK4217: symbol 'strtoul' defined in 'libucrt.lib(strtox.obj)' is imported by 'glfw3.lib(input.obj)' in function 'parseMapping'
LINK : warning LNK4217: symbol '__stdio_common_vsscanf' defined in 'libucrt.lib(input.obj)' is imported by 'glfw3.lib(context.obj)' in function '_vsscanf_l'
LINK : warning LNK4217: symbol 'wcscmp' defined in 'libucrt.lib(wcscmp.obj)' is imported by 'glfw3.lib(win32_monitor.obj)' in function '_glfwPollMonitorsWin32'
LINK : warning LNK4217: symbol 'qsort' defined in 'libucrt.lib(qsort.obj)' is imported by 'glfw3.lib(monitor.obj)' in function 'refreshVideoModes'
LINK : warning LNK4286: symbol 'qsort' defined in 'libucrt.lib(qsort.obj)' is imported by 'glfw3.lib(win32_joystick.obj)'
LINK : warning LNK4217: symbol 'powf' defined in 'libucrt.lib(powf.obj)' is imported by 'glfw3.lib(monitor.obj)' in function 'glfwSetGamma'
glfw3.lib(window.obj) : error LNK2019: unresolved external symbol __imp_strncpy referenced in function glfwWindowHintString
glfw3.lib(input.obj) : error LNK2001: unresolved external symbol __imp_strncpy
glfw3.lib(win32_joystick.obj) : error LNK2001: unresolved external symbol __imp_strncpy
glfw3.lib(input.obj) : error LNK2019: unresolved external symbol __imp_strspn referenced in function glfwUpdateGamepadMappings
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_TranslateMessage referenced in function createHelperWindow
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_TranslateMessage
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_DispatchMessageW referenced in function createHelperWindow
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_DispatchMessageW
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_PeekMessageW referenced in function createHelperWindow
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_PeekMessageW
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_RegisterDeviceNotificationW referenced in function createHelperWindow
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_UnregisterDeviceNotification referenced in function _glfwPlatformTerminate
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_CreateWindowExW referenced in function createHelperWindow
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_CreateWindowExW
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_DestroyWindow referenced in function _glfwPlatformTerminate
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_DestroyWindow
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_ShowWindow referenced in function createHelperWindow
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_ToUnicode referenced in function _glfwUpdateKeyNamesWin32
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_MapVirtualKeyW referenced in function _glfwUpdateKeyNamesWin32
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_MapVirtualKeyW
glfw3.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_SystemParametersInfoW referenced in function _glfwPlatformInit
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_SystemParametersInfoW
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_wcscpy referenced in function createMonitor
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_CreateDCW referenced in function _glfwPlatformGetGammaRamp
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_DeleteDC referenced in function _glfwPlatformGetGammaRamp
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_GetDeviceCaps referenced in function _glfwGetMonitorContentScaleWin32
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_GetDeviceGammaRamp referenced in function _glfwPlatformGetGammaRamp
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_SetDeviceGammaRamp referenced in function _glfwPlatformSetGammaRamp
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_GetDC referenced in function _glfwGetMonitorContentScaleWin32
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_GetDC
glfw3.lib(wgl_context.obj) : error LNK2001: unresolved external symbol __imp_GetDC
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_ReleaseDC referenced in function _glfwGetMonitorContentScaleWin32
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_ReleaseDC
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_ChangeDisplaySettingsExW referenced in function _glfwSetVideoModeWin32
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplaySettingsW referenced in function _glfwPlatformGetVideoModes
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplaySettingsExW referenced in function _glfwPlatformGetMonitorPos
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplayDevicesW referenced in function _glfwPollMonitorsWin32
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_GetMonitorInfoW referenced in function _glfwPlatformGetMonitorWorkarea
glfw3.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_GetMonitorInfoW
glfw3.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplayMonitors referenced in function createMonitor
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateBitmap referenced in function createIcon
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateRectRgn referenced in function updateFramebufferTransparency
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DeleteObject referenced in function createIcon
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateDIBSection referenced in function createIcon
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_TrackMouseEvent referenced in function windowProc
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetMessageTime referenced in function windowProc
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SendMessageW referenced in function _glfwPlatformSetWindowIcon
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_PostMessageW referenced in function _glfwPlatformPostEmptyEvent
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_WaitMessage referenced in function _glfwPlatformWaitEvents
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DefWindowProcW referenced in function windowProc
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_UnregisterClassW referenced in function _glfwUnregisterWindowClassWin32
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_RegisterClassExW referenced in function _glfwRegisterWindowClassWin32
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetLayeredWindowAttributes referenced in function _glfwPlatformGetWindowOpacity
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetLayeredWindowAttributes referenced in function _glfwPlatformSetWindowOpacity
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_FlashWindow referenced in function _glfwPlatformRequestWindowAttention
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_MoveWindow referenced in function _glfwPlatformSetWindowSizeLimits
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowPos referenced in function _glfwPlatformSetWindowPos
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetWindowPlacement referenced in function createNativeWindow
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowPlacement referenced in function createNativeWindow
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_IsWindowVisible referenced in function _glfwPlatformWindowVisible
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_IsIconic referenced in function _glfwPlatformWindowIconified
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_BringWindowToTop referenced in function _glfwPlatformFocusWindow
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_IsZoomed referenced in function _glfwPlatformWindowMaximized
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_OpenClipboard referenced in function _glfwPlatformSetClipboardString
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CloseClipboard referenced in function _glfwPlatformSetClipboardString
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetClipboardData referenced in function _glfwPlatformSetClipboardString
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetClipboardData referenced in function _glfwPlatformGetClipboardString
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_EmptyClipboard referenced in function _glfwPlatformSetClipboardString
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetFocus referenced in function _glfwPlatformFocusWindow
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetActiveWindow referenced in function _glfwPlatformWindowFocused
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetKeyState referenced in function _glfwPlatformPollEvents
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetCapture referenced in function windowProc
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_ReleaseCapture referenced in function windowProc
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_MsgWaitForMultipleObjects referenced in function _glfwPlatformWaitEventsTimeout
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetSystemMetrics referenced in function _glfwPlatformSetWindowIcon
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetForegroundWindow referenced in function _glfwPlatformFocusWindow
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_RedrawWindow referenced in function updateFramebufferTransparency
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetPropW referenced in function createNativeWindow
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetPropW referenced in function _glfwPlatformPollEvents
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_RemovePropW referenced in function _glfwPlatformDestroyWindow
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowTextW referenced in function _glfwPlatformSetWindowTitle
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetClientRect referenced in function _glfwPlatformGetWindowSize
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetWindowRect referenced in function _glfwPlatformSetWindowSizeLimits
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_AdjustWindowRectEx referenced in function _glfwPlatformSetWindowPos
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetCursorPos referenced in function _glfwPlatformSetCursorPos
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetCursor referenced in function updateCursorImage
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetCursorPos referenced in function _glfwPlatformGetCursorPos
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_ClientToScreen referenced in function _glfwPlatformSetCursorPos
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_ScreenToClient referenced in function _glfwPlatformGetCursorPos
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_WindowFromPoint referenced in function cursorInContentArea
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_ClipCursor referenced in function updateClipRect
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetRect referenced in function _glfwPlatformGetWindowFrameSize
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_PtInRect referenced in function cursorInContentArea
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetWindowLongW referenced in function _glfwPlatformSetWindowMonitor
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowLongW referenced in function _glfwPlatformSetWindowMonitor
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetClassLongPtrW referenced in function _glfwPlatformSetWindowIcon
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_LoadCursorW referenced in function _glfwRegisterWindowClassWin32
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DestroyIcon referenced in function _glfwPlatformDestroyCursor
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_LoadImageW referenced in function _glfwRegisterWindowClassWin32
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateIconIndirect referenced in function createIcon
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_MonitorFromWindow referenced in function _glfwPlatformGetWindowContentScale
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetRawInputData referenced in function windowProc
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_RegisterRawInputDevices referenced in function enableRawMouseMotion
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragQueryFileW referenced in function windowProc
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragQueryPoint referenced in function windowProc
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragFinish referenced in function windowProc
glfw3.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragAcceptFiles referenced in function createNativeWindow
glfw3.lib(win32_joystick.obj) : error LNK2019: unresolved external symbol __imp_GetRawInputDeviceInfoA referenced in function supportsXInput
glfw3.lib(win32_joystick.obj) : error LNK2019: unresolved external symbol __imp_GetRawInputDeviceList referenced in function supportsXInput
glfw3.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_ChoosePixelFormat referenced in function _glfwInitWGL
glfw3.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_DescribePixelFormat referenced in function _glfwCreateContextWGL
glfw3.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_SetPixelFormat referenced in function _glfwInitWGL
glfw3.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_SwapBuffers referenced in function swapBuffersWGL
glad.exe : fatal error LNK1120: 100 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64\link.EXE"' : return code '0x460'
Stop.
This is the makefile:
INC = "..\Code Files\include"
INC_SH = "..\Code Files\Shader Class"
INC_SP = "..\Code Files\Sphere"
LOC = "..\SoC Other Files"
Planet.exe: glad.obj ImageLoader.obj Shader.obj Sphere.obj Planet.obj
link /nologo /LIBPATH:$(LOC) glad.obj Planet.obj ImageLoader.obj Shader.obj Sphere.obj glfw3.lib
glad.obj: {../SoC Other Files}glad.c
cl /c /nologo /I $(LOC) "../SoC Other Files/glad.c"
ImageLoader.obj: {../SoC Other Files}ImageLoader.cpp
cl /c /nologo /I $(INC) /EHsc "../SoC Other Files/ImageLoader.cpp"
Shader.obj: {../Code Files/Shader Class}Shader.cpp
cl /c /nologo /I $(INC) /EHsc "..\Code Files\Shader Class\Shader.cpp"
Sphere.obj: {../Code Files/Sphere}Sphere.cpp
cl /c /nologo /I $(INC) /I $(INC_SH) /EHsc "../Code Files/Sphere/Sphere.cpp"
Planet.obj: {../Code Files/Main Code}Planet.cpp
cl /c /nologo /I $(INC) /I $(INC_SH) /I $(INC_SP) /EHsc "../Code Files/Main Code/Planet.cpp"

Related

I'm having troubles compiling c++ application with GLFW and vulkan libraries using clang. How can i solve this?

I'm trying to compile my c++ test application with GLFW and vulkan using clang on windows, but it fails every time. I get a lot of link errors and any of suggested solutions I could find didn't work. It seems the problem is with the GLFW library files, but I can't find a way to solve it.
Batch script I use for compiling my code:
REM Build script for the test application.
#ECHO OFF
SetLocal EnableDelayedExpansion
REM Get a list of all the .cpp files.
SET cFilenames=
FOR /R %%f in (*.cpp) do (
SET cFilenames=!cFilenames!"%%f"
)
SET assembly=test
SET compilerFlags=-g -std=c++17
REM Define what to include.
SET includeFlags=-Isrc -I../test/include -I%VULKAN_SDK%/Include -IE:/Libraries/GLFW/include -IE:/Libraries/json-3.11.2/include -IE:/Libraries/stb-master
REM Define what to link.
SET linkerFlags=-L%VULKAN_SDK%/Lib -lvulkan-1 -LE:/Libraries/GLFW/lib-vc2022 -lglfw3_mt
REM Define some extra stuff.
SET defines=-D_DEBUG
REM Build the project.
ECHO "Building %assembly%%..."
clang++ %cFilenames% %compilerFlags% -o ../bin/%assembly%.exe %defines% %includeFlags% %linkerFlags%
The errors I receive after I try to build the application:
"Building test..."
libcpmtd.lib(StlCompareStringA.obj) : error LNK2001: unresolved external symbol _malloc_dbg
libcpmtd.lib(StlLCMapStringA.obj) : error LNK2001: unresolved external symbol _malloc_dbg
libcpmtd.lib(wlocale.obj) : error LNK2001: unresolved external symbol _malloc_dbg
libcpmtd.lib(xlocale.obj) : error LNK2001: unresolved external symbol _malloc_dbg
libcpmtd.lib(xwcsxfrm.obj) : error LNK2001: unresolved external symbol _malloc_dbg
main-929849.o : error LNK2001: unresolved external symbol _malloc_dbg
libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol _malloc_dbg
libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol _malloc_dbg
libcpmtd.lib(locale.obj) : error LNK2001: unresolved external symbol _malloc_dbg
libcpmtd.lib(StlCompareStringA.obj) : error LNK2001: unresolved external symbol _free_dbg
libcpmtd.lib(StlLCMapStringA.obj) : error LNK2001: unresolved external symbol _free_dbg
libcpmtd.lib(wlocale.obj) : error LNK2001: unresolved external symbol _free_dbg
libcpmtd.lib(xlocale.obj) : error LNK2001: unresolved external symbol _free_dbg
libcpmtd.lib(xwcsxfrm.obj) : error LNK2001: unresolved external symbol _free_dbg
main-929849.o : error LNK2001: unresolved external symbol _free_dbg
libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol _free_dbg
libcpmtd.lib(locale0.obj) : error LNK2001: unresolved external symbol _free_dbg
libcpmtd.lib(locale.obj) : error LNK2001: unresolved external symbol _free_dbg
libcpmtd.lib(xlocale.obj) : error LNK2001: unresolved external symbol _CrtDbgReport
main-929849.o : error LNK2001: unresolved external symbol _CrtDbgReport
libcpmtd.lib(cout.obj) : error LNK2001: unresolved external symbol _CrtDbgReport
libcpmtd.lib(locale.obj) : error LNK2001: unresolved external symbol _CrtDbgReport
libcpmtd.lib(wlocale.obj) : error LNK2001: unresolved external symbol _CrtDbgReport
libcpmtd.lib(xlocale.obj) : error LNK2001: unresolved external symbol _calloc_dbg
main-929849.o : error LNK2001: unresolved external symbol _calloc_dbg
libcpmtd.lib(_tolower.obj) : error LNK2001: unresolved external symbol _calloc_dbg
libcpmtd.lib(locale.obj) : error LNK2001: unresolved external symbol _calloc_dbg
libcpmtd.lib(wlocale.obj) : error LNK2001: unresolved external symbol _calloc_dbg
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_TranslateMessage referenced in function _glfwPlatformInit
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_TranslateMessage
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_DispatchMessageW referenced in function _glfwPlatformInit
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_DispatchMessageW
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_PeekMessageW referenced in function _glfwPlatformInit
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_PeekMessageW
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_RegisterDeviceNotificationW referenced in function _glfwPlatformInit
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_UnregisterDeviceNotification referenced in function _glfwPlatformTerminate
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_CreateWindowExW referenced in function _glfwPlatformInit
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_CreateWindowExW
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_DestroyWindow referenced in function _glfwPlatformTerminate
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_DestroyWindow
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_ShowWindow referenced in function _glfwPlatformInit
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_ShowWindow
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_ToUnicode referenced in function _glfwPlatformInit
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_MapVirtualKeyW referenced in function _glfwPlatformInit
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_MapVirtualKeyW
glfw3_mt.lib(win32_init.obj) : error LNK2019: unresolved external symbol __imp_SystemParametersInfoW referenced in function _glfwPlatformInit
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_SystemParametersInfoW
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_CreateDCW referenced in function _glfwPlatformGetGammaRamp
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_DeleteDC referenced in function _glfwPlatformGetGammaRamp
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_GetDeviceCaps referenced in function _glfwGetMonitorContentScaleWin32
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_GetDeviceGammaRamp referenced in function _glfwPlatformGetGammaRamp
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_SetDeviceGammaRamp referenced in function _glfwPlatformSetGammaRamp
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_GetDC referenced in function _glfwGetMonitorContentScaleWin32
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_GetDC
glfw3_mt.lib(wgl_context.obj) : error LNK2001: unresolved external symbol __imp_GetDC
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_ReleaseDC referenced in function _glfwGetMonitorContentScaleWin32
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_ReleaseDC
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_ChangeDisplaySettingsExW referenced in function _glfwPlatformGetVideoModes
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplaySettingsW referenced in function _glfwPlatformGetVideoMode
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplaySettingsExW referenced in function _glfwPlatformGetMonitorPosglfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplayDevicesW referenced in function _glfwPollMonitorsWin32
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_GetMonitorInfoW referenced in function _glfwPlatformGetMonitorWorkarea
glfw3_mt.lib(win32_window.obj) : error LNK2001: unresolved external symbol __imp_GetMonitorInfoW
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_EnumDisplayMonitors referenced in function _glfwPollMonitorsWin32
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateBitmap referenced in function createIcon
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateRectRgn referenced in function updateFramebufferTransparency
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DeleteObject referenced in function createIcon
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateDIBSection referenced in function createIcon
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_TrackMouseEvent referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetMessageTime referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SendMessageW referenced in function _glfwPlatformSetWindowIcon
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_PostMessageW referenced in function _glfwPlatformPostEmptyEvent
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_WaitMessage referenced in function _glfwPlatformWaitEvents
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DefWindowProcW referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_UnregisterClassW referenced in function _glfwUnregisterWindowClassWin32
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_RegisterClassExW referenced in function _glfwRegisterWindowClassWin32
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetLayeredWindowAttributes referenced in function _glfwPlatformGetWindowOpacity
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetLayeredWindowAttributes referenced in function _glfwPlatformSetWindowOpacity
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_FlashWindow referenced in function _glfwPlatformRequestWindowAttention
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_MoveWindow referenced in function _glfwPlatformSetWindowAspectRatio
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowPos referenced in function _glfwPlatformMaximizeWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetWindowPlacement referenced in function createNativeWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowPlacement referenced in function createNativeWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_IsWindowVisible referenced in function _glfwPlatformMaximizeWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_IsIconic referenced in function _glfwPlatformWindowIconified
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_BringWindowToTop referenced in function _glfwPlatformCreateWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_IsZoomed referenced in function _glfwPlatformWindowMaximized
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_OpenClipboard referenced in function _glfwPlatformGetClipboardString
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CloseClipboard referenced in function _glfwPlatformGetClipboardString
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetClipboardData referenced in function _glfwPlatformSetClipboardString
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetClipboardData referenced in function _glfwPlatformGetClipboardString
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_EmptyClipboard referenced in function _glfwPlatformSetClipboardString
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetFocus referenced in function _glfwPlatformCreateWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetActiveWindow referenced in function _glfwPlatformPollEvents
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetKeyState referenced in function _glfwPlatformPollEvents
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetCapture referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_ReleaseCapture referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_MsgWaitForMultipleObjects referenced in function _glfwPlatformWaitEventsTimeout
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetSystemMetrics referenced in function _glfwPlatformMaximizeWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetForegroundWindow referenced in function _glfwPlatformCreateWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetPropW referenced in function createNativeWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetPropW referenced in function _glfwPlatformPollEvents
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_RemovePropW referenced in function _glfwPlatformDestroyWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowTextW referenced in function _glfwPlatformSetWindowTitle
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetClientRect referenced in function _glfwPlatformGetFramebufferSize
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetWindowRect referenced in function _glfwPlatformSetWindowAspectRatio
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_AdjustWindowRectEx referenced in function _glfwPlatformGetWindowFrameSizeglfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetCursorPos referenced in function _glfwPlatformPollEvents
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetCursor referenced in function _glfwPlatformSetCursor
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetCursorPos referenced in function _glfwPlatformGetCursorPos
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_ClientToScreen referenced in function _glfwPlatformGetWindowPos
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_ScreenToClient referenced in function _glfwPlatformGetCursorPos
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_WindowFromPoint referenced in function cursorInContentArea
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_ClipCursor referenced in function updateClipRect
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetRect referenced in function _glfwPlatformGetWindowFrameSize
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_OffsetRect referenced in function _glfwPlatformMaximizeWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_PtInRect referenced in function cursorInContentArea
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetWindowLongW referenced in function _glfwPlatformGetWindowOpacity
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_SetWindowLongW referenced in function _glfwPlatformMaximizeWindow
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetClassLongPtrW referenced in function _glfwPlatformSetWindowIcon
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_LoadCursorW referenced in function _glfwPlatformSetCursor
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DestroyIcon referenced in function _glfwPlatformDestroyCursor
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_LoadImageW referenced in function _glfwPlatformCreateStandardCursor
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateIconIndirect referenced in function createIcon
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_MonitorFromWindow referenced in function _glfwPlatformGetWindowContentScale
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_GetRawInputData referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_RegisterRawInputDevices referenced in function _glfwPlatformSetRawMouseMotion
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragQueryFileW referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragQueryPoint referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragFinish referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragAcceptFiles referenced in function createNativeWindow
glfw3_mt.lib(win32_joystick.obj) : error LNK2019: unresolved external symbol __imp_GetRawInputDeviceInfoA referenced in function deviceCallback
glfw3_mt.lib(win32_joystick.obj) : error LNK2019: unresolved external symbol __imp_GetRawInputDeviceList referenced in function deviceCallback
glfw3_mt.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_ChoosePixelFormat referenced in function _glfwInitWGL
glfw3_mt.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_DescribePixelFormat referenced in function _glfwCreateContextWGL
glfw3_mt.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_SetPixelFormat referenced in function _glfwCreateContextWGL
glfw3_mt.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_SwapBuffers referenced in function swapBuffersWGL
libcpmtd.lib(_tolower.obj) : error LNK2019: unresolved external symbol _wcsdup_dbg referenced in function _Getctype
libcpmtd.lib(xstrcoll.obj) : error LNK2001: unresolved external symbol _wcsdup_dbg
libcpmtd.lib(locale.obj) : error LNK2019: unresolved external symbol _realloc_dbg referenced in function "private: static void __cdecl std::locale::_Locimp::_Locimp_Addfac(class std::locale::_Locimp *,class std::locale::facet *,unsigned __int64)" (?_Locimp_Addfac#_Locimp#locale#std##CAXPEAV123#PEAVfacet#23#_K#Z)
libcpmtd.lib(StlLCMapStringA.obj) : error LNK2019: unresolved external symbol _CrtDbgReportW referenced in function _freea_crt
libcpmtd.lib(xmbtowc.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
libcpmtd.lib(StlCompareStringA.obj) : error LNK2001: unresolved external symbol _CrtDbgReportW
..\bin\test.exe : fatal error LNK1120: 104 unresolved externals
clang++: error: linker command failed with exit code 1120 (use -v to see invocation)
Already tried to reinstall clang, MSVCRT and GLFW. I had some clear answers, when I asked the OpenAI chatbot, but it didn't solve my problem either. Any ideas how can I solve this problem?
EDIT
I managed to solve almost all of the errors, but I still get the GLFW unresolved external symbol error.
The updated batch script I use to compile the application:
REM Build script for the test application.
#ECHO OFF
SetLocal EnableDelayedExpansion
REM Get a list of all the .cpp files.
SET cFilenames=
FOR /R %%f in (*.cpp) do (
SET cFilenames=!cFilenames!"%%f"
)
SET assembly=test
SET compilerFlags=-g -std=c++17
REM Define what to include.
SET includeFlags=-Isrc -I../test/include -I%VULKAN_SDK%/Include -IE:/Libraries/GLFW/include -IE:/Libraries/json-3.11.2/include -IE:/Libraries/stb-master
REM Define what to link.
SET linkerFlags=-luser32 -L%VULKAN_SDK%/Lib -lvulkan-1 -LE:/Libraries/GLFW/lib-vc2022 -lglfw3_mt -lmsvcrtd -llibcmtd
REM Define some extra stuff.
SET defines=-D_DEBUG -Xlinker /NODEFAULTLIB:libcmt
REM Build the project.
ECHO "Building %assembly%%..."
clang++ %cFilenames% %compilerFlags% -o ../bin/%assembly%.exe %defines% %includeFlags% %linkerFlags%
The errors that still remain:
"Building test..."
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_CreateDCW referenced in function _glfwPlatformGetGammaRamp
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_DeleteDC referenced in function _glfwPlatformGetGammaRamp
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_GetDeviceCaps referenced in function _glfwGetMonitorContentScaleWin32
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_GetDeviceGammaRamp referenced in function _glfwPlatformGetGammaRamp
glfw3_mt.lib(win32_monitor.obj) : error LNK2019: unresolved external symbol __imp_SetDeviceGammaRamp referenced in function _glfwPlatformSetGammaRamp
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateBitmap referenced in function createIcon
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateRectRgn referenced in function updateFramebufferTransparency
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DeleteObject referenced in function createIcon
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_CreateDIBSection referenced in function createIcon
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragQueryFileW referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragQueryPoint referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragFinish referenced in function windowProc
glfw3_mt.lib(win32_window.obj) : error LNK2019: unresolved external symbol __imp_DragAcceptFiles referenced in function createNativeWindow
glfw3_mt.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_ChoosePixelFormat referenced in function _glfwInitWGL
glfw3_mt.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_DescribePixelFormat referenced in function _glfwCreateContextWGL
glfw3_mt.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_SetPixelFormat referenced in function _glfwCreateContextWGL
glfw3_mt.lib(wgl_context.obj) : error LNK2019: unresolved external symbol __imp_SwapBuffers referenced in function swapBuffersWGL
..\bin\test.exe : fatal error LNK1120: 17 unresolved externals
clang++: error: linker command failed with exit code 1120 (use -v to see invocation)
Any ideas?
I managed to solve this problem by including 6 libraries and excluding 1.
For anyone who has the same problem as me, here is my batch script for compiling my code:
REM Build script for the test application.
#ECHO OFF
SetLocal EnableDelayedExpansion
REM Get a list of all the .cpp files.
SET cFilenames=
FOR /R %%f in (*.cpp) do (
SET cFilenames=!cFilenames!"%%f"
)
SET assembly=test
SET compilerFlags=-g -std=c++17
REM Define what to include.
SET includeFlags=-Isrc -I../test/include -I%VULKAN_SDK%/Include -IE:/Libraries/GLFW/include -IE:/Libraries/json-3.11.2/include -IE:/Libraries/stb-master
REM Define what to link.
SET linkerFlags=-luser32 -lkernel32 -lgdi32 -lshell32 -L%VULKAN_SDK%/Lib -lvulkan-1 -LE:/Libraries/GLFW/lib-vc2022 -lglfw3_mt -lmsvcrtd -llibcmtd
REM Define some extra stuff.
SET defines=-D_DEBUG -Xlinker /NODEFAULTLIB:libcmt
REM Build the project.
ECHO "Building %assembly%%..."
clang++ %cFilenames% %compilerFlags% -o ../bin/%assembly%.exe %defines% %includeFlags% %linkerFlags%

School Project, set up OpenGL on VS 2019 Community [duplicate]

This question already has answers here:
What is an undefined reference/unresolved external symbol error and how do I fix it?
(39 answers)
Closed 4 years ago.
I've been trying to compile C++ code and dont reliant on IDE recently,
and I decided to use an editor and command line to write and compile code.
And the problem is I want to make a glfw app but I get an error when I linking with glfw3.lib and opengl32.lib:
a.exe : fatal error LNK1120: 92 unresolved externals
os: Windows 7
compiler: clang
src/main.cpp:
#include <stdlib.h>
#include <stdio.h>
#include "window.h"
#define WIDTH 800
#define HEIGHT 600
int main(int argc, char* argv[]){
if (!Window_init(WIDTH, HEIGHT, "HELLOWORLD")){
printf("Problem loading window!\n");
return 1;
}
return 0;
}
src/window.h
#ifndef WINDOW_H
#define WINDOW_H
#include "GLFW/glfw3.h"
#define GLFW_INCLUDE_NONE
static GLFWwindow* window;
int Window_init(int width, int height, char* title);
void Window_update();
int Window_init(int width, int height, char* title){
if (!glfwInit())return 0;
glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
window = glfwCreateWindow(width, height, title,NULL, NULL);
if (!window){
return 0;
}
glfwMakeContextCurrent(window);
return 1;
}
void Window_update(){
}
#endif // !WINDOW_H
Compile command:
clang++ ..\src\*.cpp ..\src\*.h -L..\lib -lglfw3 -lopengl32 -I..\include\ -std=c++17
error:
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
glfw3.lib(init.c.obj) : warning LNK4217: locally defined symbol ___stdio_common_vsprintf imported in function __glfwInputError
glfw3.lib(wgl_context.c.obj) : warning LNK4049: locally defined symbol _free imported
glfw3.lib(egl_context.c.obj) : warning LNK4217: locally defined symbol _free imported in function __glfwInitEGL
glfw3.lib(monitor.c.obj) : warning LNK4049: locally defined symbol _free imported
glfw3.lib(vulkan.c.obj) : warning LNK4049: locally defined symbol _free imported
glfw3.lib(win32_window.c.obj) : warning LNK4049: locally defined symbol _free imported
glfw3.lib(win32_joystick.c.obj) : warning LNK4217: locally defined symbol _free imported in function _pollJoystickState
glfw3.lib(window.c.obj) : warning LNK4217: locally defined symbol _free imported in function _glfwDestroyWindow
glfw3.lib(input.c.obj) : warning LNK4217: locally defined symbol _free imported in function _glfwSetInputMode
glfw3.lib(win32_init.c.obj) : warning LNK4049: locally defined symbol _free imported
glfw3.lib(win32_monitor.c.obj) : warning LNK4049: locally defined symbol _free imported
glfw3.lib(monitor.c.obj) : warning LNK4217: locally defined symbol _qsort imported in function _refreshVideoModes
glfw3.lib(win32_joystick.c.obj) : warning LNK4049: locally defined symbol _qsort imported
glfw3.lib(wgl_context.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(egl_context.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(monitor.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(vulkan.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(win32_window.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(win32_joystick.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(window.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(input.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(win32_init.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(win32_monitor.c.obj) : error LNK2001: unresolved external symbol __imp__calloc
glfw3.lib(context.c.obj) : error LNK2019: unresolved external symbol __imp__strstr referenced in function __glfwStringInExtensionString
glfw3.lib(win32_joystick.c.obj) : error LNK2001: unresolved external symbol __imp__strstr
glfw3.lib(context.c.obj) : error LNK2019: unresolved external symbol __imp__strncmp referenced in function __glfwRefreshContextAttribs
glfw3.lib(egl_context.c.obj) : error LNK2001: unresolved external symbol __imp__strncmp
glfw3.lib(context.c.obj) : error LNK2019: unresolved external symbol __imp____stdio_common_vsscanf referenced in function __vsscanf_l
glfw3.lib(win32_init.c.obj) : error LNK2019: unresolved external symbol __imp__RegisterDeviceNotificationW#12 referenced in function _createHelperWindow
glfw3.lib(win32_init.c.obj) : error LNK2019: unresolved external symbol __imp__CreateWindowExW#48 referenced in function _createHelperWindow
glfw3.lib(win32_window.c.obj) : error LNK2001: unresolved external symbol __imp__CreateWindowExW#48
glfw3.lib(win32_init.c.obj) : error LNK2019: unresolved external symbol __imp__DestroyWindow#4 referenced in function __glfwPlatformTerminate
glfw3.lib(win32_window.c.obj) : error LNK2001: unresolved external symbol __imp__DestroyWindow#4
glfw3.lib(win32_init.c.obj) : error LNK2019: unresolved external symbol __imp__ShowWindow#8 referenced in function _createHelperWindow
glfw3.lib(win32_window.c.obj) : error LNK2001: unresolved external symbol __imp__ShowWindow#8
glfw3.lib(win32_init.c.obj) : error LNK2019: unresolved external symbol __imp__SystemParametersInfoW#16 referenced in function __glfwPlatformInit
glfw3.lib(win32_monitor.c.obj) : error LNK2019: unresolved external symbol __imp__CreateDCW#16 referenced in function __glfwPlatformGetGammaRamp
glfw3.lib(win32_monitor.c.obj) : error LNK2019: unresolved external symbol __imp__DeleteDC#4 referenced in function __glfwPlatformGetGammaRamp
glfw3.lib(win32_monitor.c.obj) : error LNK2019: unresolved external symbol __imp__GetDeviceCaps#8 referenced in function _createMonitor
glfw3.lib(win32_monitor.c.obj) : error LNK2019: unresolved external symbol __imp__GetDeviceGammaRamp#8 referenced in function __glfwPlatformGetGammaRamp
glfw3.lib(win32_monitor.c.obj) : error LNK2019: unresolved external symbol __imp__SetDeviceGammaRamp#8 referenced in function __glfwPlatformSetGammaRamp
glfw3.lib(win32_monitor.c.obj) : error LNK2019: unresolved external symbol __imp__ChangeDisplaySettingsExW#20 referenced in function __glfwPlatformGetVideoModes
glfw3.lib(win32_monitor.c.obj) : error LNK2019: unresolved external symbol __imp__EnumDisplaySettingsW#12 referenced in function __glfwPlatformGetVideoMode
glfw3.lib(win32_monitor.c.obj) : error LNK2019: unresolved external symbol __imp__EnumDisplaySettingsExW#16 referenced in function __glfwPlatformGetMonitorPos
glfw3.lib(win32_monitor.c.obj) : error LNK2019: unresolved external symbol __imp__EnumDisplayDevicesW#16 referenced in function __glfwPlatformGetMonitors
glfw3.lib(win32_monitor.c.obj) : error LNK2019: unresolved external symbol __imp__realloc referenced in function __glfwPlatformGetMonitors
glfw3.lib(monitor.c.obj) : error LNK2019: unresolved external symbol __imp___strdup referenced in function __glfwAllocMonitor
glfw3.lib(win32_window.c.obj) : error LNK2001: unresolved external symbol __imp___strdup
glfw3.lib(win32_joystick.c.obj) : error LNK2001: unresolved external symbol __imp___strdup
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__CreateBitmap#20 referenced in function _createIcon
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__DeleteObject#4 referenced in function _createIcon
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__CreateDIBSection#24 referenced in function _createIcon
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__TrackMouseEvent#4 referenced in function _windowProc#16
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__TranslateMessage#4 referenced in function __glfwPlatformPollEvents
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__DispatchMessageW#4 referenced in function __glfwPlatformPollEvents
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__PeekMessageW#20 referenced in function __glfwPlatformPollEvents
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetMessageTime#0 referenced in function _translateKey
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SendMessageW#16 referenced in function __glfwPlatformSetWindowIcon
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__PostMessageW#16 referenced in function __glfwPlatformPostEmptyEvent
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__WaitMessage#0 referenced in function __glfwPlatformWaitEvents
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__DefWindowProcW#16 referenced in function _windowProc#16
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__UnregisterClassW#8 referenced in function __glfwUnregisterWindowClassWin32
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__RegisterClassExW#4 referenced in function __glfwRegisterWindowClassWin32
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__MoveWindow#24 referenced in function __glfwPlatformSetWindowAspectRatio
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetWindowPos#28 referenced in function __glfwPlatformSetWindowMonitor
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__IsWindowVisible#4 referenced in function __glfwPlatformWindowVisible
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__IsIconic#4 referenced in function __glfwPlatformWindowIconified
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__BringWindowToTop#4 referenced in function __glfwPlatformCreateWindow
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__IsZoomed#4 referenced in function __glfwPlatformWindowMaximized
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__OpenClipboard#4 referenced in function __glfwPlatformGetClipboardString
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__CloseClipboard#0 referenced in function __glfwPlatformGetClipboardString
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetClipboardData#8 referenced in function __glfwPlatformSetClipboardString
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetClipboardData#4 referenced in function __glfwPlatformGetClipboardString
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__EmptyClipboard#0 referenced in function __glfwPlatformSetClipboardString
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetFocus#4 referenced in function __glfwPlatformCreateWindow
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetActiveWindow#0 referenced in function __glfwPlatformPollEvents
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetKeyState#4 referenced in function _getKeyMods
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetAsyncKeyState#4 referenced in function __glfwPlatformPollEvents
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetKeyNameTextW#12 referenced in function __glfwPlatformGetKeyName
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetCapture#4 referenced in function _windowProc#16
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__ReleaseCapture#0 referenced in function _windowProc#16
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__MsgWaitForMultipleObjects#20 referenced in function __glfwPlatformWaitEventsTimeout
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetSystemMetrics#4 referenced in function __glfwPlatformSetWindowIcon
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetForegroundWindow#4 referenced in function __glfwPlatformCreateWindow
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetDC#4 referenced in function _createIcon
glfw3.lib(wgl_context.c.obj) : error LNK2001: unresolved external symbol __imp__GetDC#4
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__ReleaseDC#8 referenced in function _createIcon
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetPropW#12 referenced in function _createNativeWindow
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetPropW#8 referenced in function __glfwPlatformPollEvents
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__RemovePropW#8 referenced in function __glfwPlatformDestroyWindow
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetWindowTextW#8 referenced in function __glfwPlatformSetWindowTitle
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetClientRect#8 referenced in function __glfwPlatformGetFramebufferSize
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetWindowRect#8 referenced in function __glfwPlatformSetWindowAspectRatio
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__AdjustWindowRectEx#16 referenced in function __glfwPlatformGetWindowFrameSize
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetCursorPos#8 referenced in function __glfwPlatformPollEvents
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetCursor#4 referenced in function __glfwPlatformSetCursor
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetCursorPos#4 referenced in function __glfwPlatformGetCursorPos
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__ClipCursor#4 referenced in function __glfwPlatformSetCursorMode
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__ClientToScreen#8 referenced in function __glfwPlatformGetWindowPos
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__ScreenToClient#8 referenced in function __glfwPlatformGetCursorPos
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__WindowFromPoint#8 referenced in function _cursorInClientArea
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetRect#20 referenced in function __glfwPlatformGetWindowFrameSize
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__PtInRect#12 referenced in function _cursorInClientArea
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetWindowLongW#8 referenced in function __glfwPlatformSetWindowMonitor
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__SetWindowLongW#12 referenced in function __glfwPlatformSetWindowMonitor
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__GetClassLongW#8 referenced in function __glfwPlatformSetWindowIcon
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__LoadCursorW#8 referenced in function __glfwPlatformCreateStandardCursor
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__DestroyIcon#4 referenced in function __glfwPlatformDestroyCursor
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__LoadImageW#24 referenced in function __glfwRegisterWindowClassWin32
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__CreateIconIndirect#4 referenced in function _createIcon
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__CopyIcon#4 referenced in function __glfwPlatformCreateStandardCursor
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__DragQueryFileW#16 referenced in function _windowProc#16
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__DragQueryPoint#8 referenced in function _windowProc#16
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__DragFinish#4 referenced in function _windowProc#16
glfw3.lib(win32_window.c.obj) : error LNK2019: unresolved external symbol __imp__DragAcceptFiles#8 referenced in function _createNativeWindow
glfw3.lib(win32_joystick.c.obj) : error LNK2019: unresolved external symbol __imp__GetRawInputDeviceInfoA#16 referenced in function _supportsXInput
glfw3.lib(win32_joystick.c.obj) : error LNK2019: unresolved external symbol __imp__GetRawInputDeviceList#12 referenced in function _supportsXInput
glfw3.lib(wgl_context.c.obj) : error LNK2019: unresolved external symbol __imp__ChoosePixelFormat#8 referenced in function _loadWGLExtensions
glfw3.lib(wgl_context.c.obj) : error LNK2019: unresolved external symbol __imp__DescribePixelFormat#16 referenced in function __glfwCreateContextWGL
glfw3.lib(wgl_context.c.obj) : error LNK2019: unresolved external symbol __imp__SetPixelFormat#12 referenced in function __glfwCreateContextWGL
glfw3.lib(wgl_context.c.obj) : error LNK2019: unresolved external symbol __imp__SwapBuffers#4 referenced in function _swapBuffersWGL
MSVCRT.lib(_chandler4gs_.obj) : error LNK2019: unresolved external symbol __except_handler4_common referenced in function __except_handler4
a.exe : fatal error LNK1120: 92 unresolved externals
clang++.exe: error: linker command failed with exit code 1120 (use -v to see invocation)
Lets demonstrate you the algorithm.
Let we see __imp__GetRawInputDeviceInfoA between unresolved symbols.
Google GetRawInputDeviceInfoA.
First page in results is https://msdn.microsoft.com/en-us/library/windows/desktop/ms645597(v=vs.85).aspx
Open and scroll the page to the bottom. We see there | Library | User32.lib |.
Add the library to the command line: clang++ ..\src\*.cpp -L..\lib -lglfw3 -lopengl32 -I..\include\ -std=c++17 User32.lib
Try to build.
Repeat from 1 till 6 until all unresolved symbols are fixed.
Remove ..\src\*.h from the command line.

How to correctly statically link libcurl on Windows using Clang? (64bit)

Recently, for many reasons, I switched on Windows from GCC to Clang and I want to use libcurl in a simple program, but I feel there is no guide how to setup Clang for that.
I use
clang++ -static -DCURL_STATICLIB curl-7.64.1-win64-mingw/lib/libcurl.a http-post.cpp -std=c++17 -g -Xclang -flto-visibility-public-std -o trading.exe
in VSCode and I don't even want to use Make or CMake since it's simple program.
With that command I get:
libcurl.a(formdata.o) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function Curl_getformdata
libcurl.a(setopt.o) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function vsetopt
libcurl.a(url.o) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function Curl_builtin_scheme
libcurl.a(cookie.o) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function Curl_cookie_init
libcurl.a(mprintf.o) : warning LNK4217: locally defined symbol __acrt_iob_func imported in function dprintf_formatf
libcurl.a(inet_ntop.o) : warning LNK4049: locally defined symbol _errno imported
libcurl.a(strtoofft.o) : warning LNK4049: locally defined symbol _errno imported
libcurl.a(parsedate.o) : warning LNK4049: locally defined symbol _errno imported
libcurl.a(strerror.o) : warning LNK4217: locally defined symbol _errno imported in function Curl_strerror
libcurl.a(asyn-thread.o) : warning LNK4217: locally defined symbol _errno imported in function Curl_resolver_cancel
libcurl.a(connect.o) : warning LNK4217: locally defined symbol _errno imported in function Curl_is_connected
libcurl.a(inet_pton.o) : warning LNK4049: locally defined symbol _errno imported
libcurl.a(strerror.o) : warning LNK4217: locally defined symbol _sys_nerr imported in function Curl_strerror
libcurl.a(hostip.o) : warning LNK4217: locally defined symbol tolower imported in function fetch_addr
libcurl.a(url.o) : warning LNK4217: locally defined symbol tolower imported in function Curl_freeset
libcurl.a(urlapi.o) : warning LNK4217: locally defined symbol tolower imported in function parseurl
libcurl.a(x509asn1.o) : warning LNK4217: locally defined symbol isupper imported in function ASN1tostr
libcurl.a(easy.o) : error LNK2019: unresolved external symbol strdup referenced in function global_init
libcurl.a(easy.o) : error LNK2019: unresolved external symbol libssh2_init referenced in function global_init
libcurl.a(easy.o) : error LNK2019: unresolved external symbol libssh2_exit referenced in function curl_global_cleanup
libcurl.a(system_win32.o) : error LNK2019: unresolved external symbol __imp_WSAStartup referenced in function Curl_win32_init
libcurl.a(telnet.o) : error LNK2001: unresolved external symbol __imp_WSAStartup
libcurl.a(system_win32.o) : error LNK2019: unresolved external symbol __imp_WSACleanup referenced in function Curl_win32_init
libcurl.a(telnet.o) : error LNK2001: unresolved external symbol __imp_WSACleanup
libcurl.a(tftp.o) : error LNK2019: unresolved external symbol __imp_WSAGetLastError referenced in function tftp_disconnect
libcurl.a(openssl.o) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
libcurl.a(schannel.o) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
libcurl.a(ftp.o) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
libcurl.a(telnet.o) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
libcurl.a(asyn-thread.o) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
libcurl.a(select.o) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
libcurl.a(sendf.o) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
libcurl.a(connect.o) : error LNK2001: unresolved external symbol __imp_WSAGetLastError
libcurl.a(hostip6.o) : error LNK2019: unresolved external symbol __imp_socket referenced in function Curl_ipv6works
libcurl.a(connect.o) : error LNK2001: unresolved external symbol __imp_socket
libcurl.a(select.o) : error LNK2019: unresolved external symbol __imp_WSASetLastError referenced in function Curl_wait_ms
libcurl.a(connect.o) : error LNK2001: unresolved external symbol __imp_WSASetLastError
libcurl.a(curl_addrinfo.o) : error LNK2001: unresolved external symbol __imp_WSASetLastError
libcurl.a(select.o) : error LNK2019: unresolved external symbol __imp_select referenced in function Curl_socket_check
libcurl.a(select.o) : error LNK2019: unresolved external symbol __WSAFDIsSet referenced in function Curl_socket_check
libcurl.a(version.o) : error LNK2019: unresolved external symbol zlibVersion referenced in function curl_version
libcurl.a(content_encoding.o) : error LNK2001: unresolved external symbol zlibVersion
libcurl.a(version.o) : error LNK2019: unresolved external symbol BrotliDecoderVersion referenced in function curl_version
libcurl.a(version.o) : error LNK2019: unresolved external symbol libssh2_version referenced in function curl_version
libcurl.a(tftp.o) : error LNK2019: unresolved external symbol __imp__time64 referenced in function tftp_done
libcurl.a(hostip.o) : error LNK2001: unresolved external symbol __imp__time64
libcurl.a(cookie.o) : error LNK2001: unresolved external symbol __imp__time64
libcurl.a(http.o) : error LNK2001: unresolved external symbol __imp__time64
libcurl.a(ftp.o) : error LNK2001: unresolved external symbol __imp__time64
libcurl.a(rtsp.o) : error LNK2001: unresolved external symbol sscanf
libcurl.a(parsedate.o) : error LNK2001: unresolved external symbol sscanf
libcurl.a(http.o) : error LNK2001: unresolved external symbol sscanf
libcurl.a(ftp.o) : error LNK2001: unresolved external symbol sscanf
libcurl.a(telnet.o) : error LNK2001: unresolved external symbol sscanf
libcurl.a(imap.o) : error LNK2001: unresolved external symbol sscanf
libcurl.a(hostip.o) : error LNK2001: unresolved external symbol sscanf
libcurl.a(cookie.o) : error LNK2001: unresolved external symbol sscanf
libcurl.a(urlapi.o) : error LNK2001: unresolved external symbol sscanf
libcurl.a(http_proxy.o) : error LNK2001: unresolved external symbol sscanf
libcurl.a(sendf.o) : error LNK2019: unresolved external symbol __imp_recv referenced in function Curl_send_plain
libcurl.a(connect.o) : error LNK2001: unresolved external symbol __imp_recv
libcurl.a(openssl.o) : error LNK2001: unresolved external symbol __imp_recv
libcurl.a(sendf.o) : error LNK2019: unresolved external symbol __imp_send referenced in function Curl_send_plain
libcurl.a(telnet.o) : error LNK2001: unresolved external symbol __imp_send
libcurl.a(mime.o) : error LNK2019: unresolved external symbol __imp__stat64 referenced in function curl_mime_data
libcurl.a(mime.o) : error LNK2019: unresolved external symbol access referenced in function curl_mime_data
libcurl.a(ssh.o) : error LNK2001: unresolved external symbol access
libcurl.a(warnless.o) : error LNK2019: unresolved external symbol read referenced in function curlx_read
libcurl.a(warnless.o) : error LNK2019: unresolved external symbol write referenced in function curlx_write
libcurl.a(cookie.o) : error LNK2019: unresolved external symbol ___chkstk_ms referenced in function Curl_cookie_add
libcurl.a(mprintf.o) : error LNK2001: unresolved external symbol ___chkstk_ms
libcurl.a(netrc.o) : error LNK2001: unresolved external symbol ___chkstk_ms
libcurl.a(formdata.o) : error LNK2001: unresolved external symbol ___chkstk_ms
libcurl.a(connect.o) : error LNK2019: unresolved external symbol __imp_getpeername referenced in function Curl_updateconninfo
libcurl.a(connect.o) : error LNK2019: unresolved external symbol __imp_getsockname referenced in function Curl_updateconninfo
libcurl.a(ftp.o) : error LNK2001: unresolved external symbol __imp_getsockname
libcurl.a(connect.o) : error LNK2019: unresolved external symbol __imp_ntohs referenced in function getaddressinfo
libcurl.a(ftp.o) : error LNK2001: unresolved external symbol __imp_ntohs
libcurl.a(socks_sspi.o) : error LNK2001: unresolved external symbol __imp_ntohs
libcurl.a(connect.o) : error LNK2019: unresolved external symbol __imp_getsockopt referenced in function Curl_is_connected
libcurl.a(connect.o) : error LNK2019: unresolved external symbol __imp_closesocket referenced in function Curl_closesocket
libcurl.a(connect.o) : error LNK2019: unresolved external symbol __imp_setsockopt referenced in function Curl_sndbufset
libcurl.a(transfer.o) : error LNK2001: unresolved external symbol __imp_setsockopt
libcurl.a(connect.o) : error LNK2019: unresolved external symbol __imp_WSAIoctl referenced in function Curl_connecthost
libcurl.a(transfer.o) : error LNK2001: unresolved external symbol __imp_WSAIoctl
libcurl.a(telnet.o) : error LNK2001: unresolved external symbol __imp_htons
libcurl.a(smb.o) : error LNK2001: unresolved external symbol __imp_htons
libcurl.a(socks_sspi.o) : error LNK2001: unresolved external symbol __imp_htons
libcurl.a(connect.o) : error LNK2001: unresolved external symbol __imp_htons
libcurl.a(curl_addrinfo.o) : error LNK2001: unresolved external symbol __imp_htons
libcurl.a(doh.o) : error LNK2001: unresolved external symbol __imp_htons
libcurl.a(ftp.o) : error LNK2001: unresolved external symbol __imp_htons
libcurl.a(connect.o) : error LNK2019: unresolved external symbol __imp_bind referenced in function Curl_connecthost
libcurl.a(ftp.o) : error LNK2001: unresolved external symbol __imp_bind
libcurl.a(tftp.o) : error LNK2001: unresolved external symbol __imp_bind
libcurl.a(connect.o) : error LNK2019: unresolved external symbol __imp_connect referenced in function Curl_connecthost
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_version referenced in function Curl_http2_ver
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_submit_rst_stream referenced in function Curl_http2_done
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_send referenced in function Curl_http2_done
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_set_stream_user_data referenced in function Curl_http2_done
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_pack_settings_payload referenced in function Curl_http2_request_upgrade
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_resume_data referenced in function Curl_http2_done_sending
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_mem_recv referenced in function h2_process_pending_input
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_strerror referenced in function h2_process_pending_input
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_priority_spec_init referenced in function h2_process_pending_input
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_submit_priority referenced in function h2_process_pending_input
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_want_read referenced in function h2_process_pending_input
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_want_write referenced in function h2_process_pending_input
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_callbacks_new referenced in function Curl_http2_setup
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_callbacks_set_send_callback referenced in function Curl_http2_setup
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_callbacks_set_on_frame_recv_callback referenced in function Curl_http2_setup
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_callbacks_set_on_data_chunk_recv_callback referenced in function Curl_http2_setup
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_callbacks_set_on_stream_close_callback referenced in function Curl_http2_setup
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_callbacks_set_on_begin_headers_callback referenced in function Curl_http2_setup
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_callbacks_set_on_header_callback referenced in function Curl_http2_setup
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_callbacks_set_error_callback referenced in function Curl_http2_setup
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_client_new referenced in function Curl_http2_setup
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_callbacks_del referenced in function Curl_http2_setup
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_upgrade referenced in function Curl_http2_switched
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_submit_settings referenced in function Curl_http2_switched
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_set_local_window_size referenced in function Curl_http2_switched
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_is_fatal referenced in function Curl_http2_switched
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_submit_request referenced in function http2_send
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_del referenced in function http2_disconnect
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_submit_ping referenced in function http2_conncheck
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_get_stream_user_data referenced in function http2_conncheck
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_session_get_remote_settings referenced in function http2_conncheck
libcurl.a(http2.o) : error LNK2019: unresolved external symbol nghttp2_http2_strerror referenced in function http2_conncheck
libcurl.a(content_encoding.o) : error LNK2019: unresolved external symbol inflateInit_ referenced in function deflate_init_writer
libcurl.a(content_encoding.o) : error LNK2019: unresolved external symbol inflateEnd referenced in function deflate_unencode_write
libcurl.a(content_encoding.o) : error LNK2019: unresolved external symbol inflate referenced in function deflate_close_writer
libcurl.a(content_encoding.o) : error LNK2019: unresolved external symbol inflateInit2_ referenced in function deflate_close_writer
libcurl.a(content_encoding.o) : error LNK2019: unresolved external symbol BrotliDecoderCreateInstance referenced in function brotli_init_writer
libcurl.a(content_encoding.o) : error LNK2019: unresolved external symbol BrotliDecoderDecompressStream referenced in function brotli_unencode_write
libcurl.a(content_encoding.o) : error LNK2019: unresolved external symbol BrotliDecoderDestroyInstance referenced in function brotli_unencode_write
libcurl.a(content_encoding.o) : error LNK2019: unresolved external symbol BrotliDecoderGetErrorCode referenced in function brotli_unencode_write
libcurl.a(mprintf.o) : error LNK2019: unresolved external symbol sprintf referenced in function dprintf_formatf
libcurl.a(md5.o) : error LNK2019: unresolved external symbol MD5_Init referenced in function Curl_md5it
libcurl.a(md5.o) : error LNK2019: unresolved external symbol MD5_Update referenced in function Curl_md5it
libcurl.a(md5.o) : error LNK2019: unresolved external symbol MD5_Final referenced in function Curl_md5it
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol OPENSSL_load_builtin_modules referenced in function Curl_ossl_init
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ENGINE_load_builtin_engines referenced in function Curl_ossl_init
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol CONF_modules_load_file referenced in function Curl_ossl_init
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol CRYPTO_get_ex_new_index referenced in function Curl_ossl_init
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol OpenSSL_version_num referenced in function Curl_ossl_version
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_shutdown referenced in function Curl_ossl_shutdown
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ERR_clear_error referenced in function Curl_ossl_shutdown
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_read referenced in function Curl_ossl_shutdown
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_get_error referenced in function Curl_ossl_shutdown
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ERR_get_error referenced in function Curl_ossl_shutdown
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ERR_error_string_n referenced in function Curl_ossl_shutdown
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_free referenced in function Curl_ossl_shutdown
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_pending referenced in function Curl_ossl_data_pending
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol RAND_status referenced in function Curl_ossl_random
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol RAND_bytes referenced in function Curl_ossl_random
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_set_connect_state referenced in function Curl_ossl_close
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CTX_free referenced in function Curl_ossl_close
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ENGINE_finish referenced in function Curl_ossl_close_all
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ENGINE_free referenced in function Curl_ossl_close_all
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_SESSION_free referenced in function Curl_ossl_session_free
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ENGINE_by_id referenced in function Curl_ossl_set_engine
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ENGINE_init referenced in function Curl_ossl_set_engine
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ENGINE_set_default referenced in function Curl_ossl_set_engine_default
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ENGINE_get_id referenced in function Curl_ossl_set_engine_default
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ENGINE_get_first referenced in function Curl_ossl_engines_list
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ENGINE_get_next referenced in function Curl_ossl_engines_list
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_MD_CTX_new referenced in function Curl_ossl_md5sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_md5 referenced in function Curl_ossl_md5sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_DigestInit_ex referenced in function Curl_ossl_md5sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_DigestUpdate referenced in function Curl_ossl_md5sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_DigestFinal_ex referenced in function Curl_ossl_md5sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_MD_CTX_free referenced in function Curl_ossl_md5sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_sha256 referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol RAND_load_file referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol RAND_add referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol RAND_file_name referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_connect referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_version referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_get_current_cipher referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CIPHER_get_name referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_get0_alpn_selected referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_get_verify_result referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_verify_cert_error_string referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol TLS_client_method referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CTX_new referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CTX_ctrl referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CTX_set_msg_callback referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ERR_peek_error referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol BIO_s_mem referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol BIO_new referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_get_peer_cert_chain referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol OPENSSL_sk_num referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol OPENSSL_sk_value referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_get_subject_name referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_NAME_print_ex referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol BIO_ctrl referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_get_issuer_name referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_get_version referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol BIO_printf referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_get_serialNumber referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol BIO_puts referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ASN1_STRING_new referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_get0_signature referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_signature_print referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ASN1_STRING_free referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol i2a_ASN1_OBJECT referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_get0_extensions referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_EXTENSION_get_object referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol i2t_ASN1_OBJECT referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509V3_EXT_print referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_EXTENSION_get_data referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ASN1_STRING_print referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol BIO_free referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_get0_notBefore referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ASN1_TIME_print referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_get0_notAfter referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_get_pubkey referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_PKEY_id referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_PKEY_get0_RSA referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol RSA_get0_key referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol BN_print referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_PKEY_get0_DSA referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol DSA_get0_pqg referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol DSA_get0_key referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_PKEY_get0_DH referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol DH_get0_pqg referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol DH_get0_key referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol EVP_PKEY_free referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol PEM_write_bio_X509 referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_get_peer_certificate referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol X509_get_ext_d2i referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ASN1_STRING_get0_data referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol ASN1_STRING_length referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CTX_set_options referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CTX_set_next_proto_select_cb referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CTX_set_alpn_protos referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CTX_set_default_passwd_cb_userdata referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CTX_set_default_passwd_cb referenced in function Curl_ossl_sha256sum
libcurl.a(openssl.o) : error LNK2019: unresolved external symbol SSL_CTX_use_certificate_file referenced in function Curl_ossl_sha256sum
..
trading.exe : fatal error LNK1120: 376 unresolved externals
clang++: error: linker command failed with exit code 1120 (use -v to see invocation)
The terminal process terminated with exit code: 1
How to setup the build command correctly?
And can I use something more neat than
-std=c++17 -Xclang -flto-visibility-public-std
to use the newest C++ and STL functionality?
EDIT: According to https://github.com/Microsoft/vcpkg/issues/2621, I need something like Ws2_32.Lib, Wldap32.Lib and Crypt32.Lib and I somehow thought about that, but as I feel that Clang is somehow cross-platform, I thought it has it's own binaries for that functionality and it doesn't feel very neat to link those Windows libs...
EDIT2: Especially when I link libcurl.a, not .lib.
EDIT3: It is missing strdup anyway, which is POSIX, so I am not sure if should I use a link flag or include a file having definition of that function etc...
The option -static means to produce a static library. You are obviously producing an executable. Just remove that option and it should be ok. Also you might have to put the cpp file before libcurl for link requirements.
Edit: My mistake. The -static option for gcc makes it prefer a static library when both static and shared are found for the -l option. Here you are explicitly linking with the static library. Still, the -static option is not required.
Serves me right for not reading the full output. You are missing a lot of other dependencies, e.g. WinSock, C runtime, zlib, ssl.

error LNK2019 unresolved external symbol dbbind referenced in function

I'm trying to compile tds_fdw for Windows 64bit using Visual Studio Community 2017, but I'm getting the errors below.
The C/C++ Additional Include Directories are:
E:\Downloads\FreeTDS-1.00-x86\freetds-1.00\include
C:\Apps\postgres\pgsql-10.0\include\server\port\win32_msvc
C:\Apps\postgres\pgsql-10.0\include\server\port\win32
C:\Apps\postgres\pgsql-10.0\include
C:\Apps\postgres\pgsql-10.0\include\server
E:\Workspace\git\tds_fdw\include
%(AdditionalIncludeDirectories)
The Linker Input has Additional Dependencies:
C:\Apps\postgres\pgsql-10.0\lib\postgres.lib
What am I missing?
1>------ Rebuild All started: Project: tds_fdw, Configuration: Release x64 ------
1>deparse.c
1>options.c
1>tds_fdw.c
1>Generating Code...
1> Creating library E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.lib and object E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.exp
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbbind referenced in function tdsGetRowCountShowPlanAll
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbclose referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcmd referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcolname referenced in function tdsGetColumnMetadata
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcoltype referenced in function tdsGetColumnMetadata
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbconvert referenced in function tdsConvertToCString
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbiscount referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbcount referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdata referenced in function tdsIterateForeignScan
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdatecrack referenced in function tdsDatetimeToDatum
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbdatlen referenced in function tdsIterateForeignScan
1>tds_fdw.obj : error LNK2019: unresolved external symbol dberrhandle referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbexit referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbinit referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dblogin referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbloginfree referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbmsghandle referenced in function estimate_path_cost_size
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbnextrow referenced in function tdsGetRowCountExecute
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbnumcols referenced in function tdsGetRowCountShowPlanAll
1>tds_fdw.obj : error LNK2019: unresolved external symbol tdsdbopen referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbresults referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsqlexec referenced in function tdsExecuteQuery
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbuse referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbwillconvert referenced in function tdsConvertToCString
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsetlname referenced in function tdsSetupConnection
1>tds_fdw.obj : error LNK2019: unresolved external symbol dbsetlversion referenced in function tdsSetupConnection
1>E:\Workspace\git\tds_fdw\x64\Release\tds_fdw.dll : fatal error LNK1120: 26 unresolved externals
1>Done building project "tds_fdw.vcxproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Update: files from FreeTDS
freetds-1.00\bin
freetds-1.00\etc
freetds-1.00\include
freetds-1.00\lib
freetds-1.00\README.tests
freetds-1.00\sbin
freetds-1.00\var
freetds-1.00\bin\bsqldb.exe
freetds-1.00\bin\bsqlodbc.exe
freetds-1.00\bin\datacopy.exe
freetds-1.00\bin\defncopy.exe
freetds-1.00\bin\freebcp.exe
freetds-1.00\bin\osql
freetds-1.00\bin\sqsh.exe
freetds-1.00\bin\tsql.exe
freetds-1.00\etc\freetds.conf
freetds-1.00\etc\locales.conf
freetds-1.00\etc\pool.conf
freetds-1.00\include\bkpublic.h
freetds-1.00\include\cspublic.h
freetds-1.00\include\cstypes.h
freetds-1.00\include\ctpublic.h
freetds-1.00\include\odbcss.h
freetds-1.00\include\sqldb.h
freetds-1.00\include\sqlfront.h
freetds-1.00\include\sybdb.h
freetds-1.00\include\syberror.h
freetds-1.00\include\sybfront.h
freetds-1.00\include\tds_sysdep_public.h
freetds-1.00\lib\libct.a
freetds-1.00\lib\libct.la
freetds-1.00\lib\libsybdb.a
freetds-1.00\lib\libsybdb.la
freetds-1.00\lib\libtdsodbc.a
freetds-1.00\lib\libtdsodbc.la
freetds-1.00\lib\pkgconfig
freetds-1.00\lib\pkgconfig\freetds.pc
freetds-1.00\sbin\tdspool.exe
freetds-1.00\sbin\tdssrv.exe
freetds-1.00\var\log
You failed to link to the FreeTDS .lib. You'll also need to ensure the associated .dll is in your PATH or copied to the same directory as the extension you built.

Libcurl windows build VS2015 OpenSSL HTTP2

I am currently trying to build Libcurl 7.54.0 with OpenSSL and HTTP2 on windows 10 using Visual Studio 2015 and I am getting these errors in the build log at the end of compilation:
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_new referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_del referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_send_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_frame_recv_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_invalid_frame_recv_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_data_chunk_recv_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_before_frame_send_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_frame_send_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_frame_not_send_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_stream_close_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_begin_headers_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_on_header_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_callbacks_set_error_callback referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_client_new referenced in function _Curl_http2_init
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_del referenced in function _http2_disconnect
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_send referenced in function _h2_session_send
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_mem_recv referenced in function _Curl_http2_switched
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_resume_data referenced in function _Curl_http2_done_sending
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_want_read referenced in function _should_close_session
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_want_write referenced in function _http2_perform_getsock
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_get_stream_user_data referenced in function _before_frame_send
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_set_stream_user_data referenced in function _Curl_http2_done
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_get_remote_settings referenced in function _on_frame_recv
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_upgrade referenced in function _Curl_http2_switched
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_pack_settings_payload referenced in function _Curl_http2_request_upgrade
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_strerror referenced in function _Curl_http2_switched
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_http2_strerror referenced in function _Curl_http2_strerror
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_priority_spec_init referenced in function _h2_pri_spec
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_submit_request referenced in function _http2_send
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_submit_priority referenced in function _h2_session_send
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_submit_rst_stream referenced in function _Curl_http2_done
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_submit_settings referenced in function _Curl_http2_switched
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_session_set_local_window_size referenced in function _Curl_http2_switched
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_version referenced in function _Curl_http2_ver
1>libcurl.lib(http2.obj) : error LNK2019: unresolved external symbol __imp__nghttp2_is_fatal referenced in function _Curl_http2_switched
1>..\..\..\..\build\Win32\VC14\LIB Release - DLL OpenSSL\curl.exe : fatal error LNK1120: 35 unresolved externals
According to OpenSSL & nghttp2 path on my computer, I have added the following to curl & libcurl project:
I have added the following folders to my additionnal library directories (curl project->properties->configuration properties->linker->general->additionnal library directories) :
C:\OpenSSL-Win32\lib
C:\nghttp2-1.22.0\lib
And added for both curl and libcurl project additionnal include directories (both projects->properties->configuration properties->c/c++->general->additionnal include directories) :
C:\OpenSSL-Win32\include
C:\nghttp2-1.22.0\lib\includes
I also added the definition of USE_NGHTTP2 to both project preprocessor definitions (both projects->properties->configuration properties->C/C++->Preprocessor->Preprocessor Definitions) in order to compile with nghttp2.
Finally, I am building using configuration "LIB Release - DLL OpenSSL" with target platform Win32.
Edit: the issue seems to be related to nghttp2 as I successfully build without the NGHTTP2 preprocessor definition.
I am surely missing something but I can't see what at the moment.
Thank you for your assistance
Lucas