Hello. I want to link my VS2022 project with GLFW statically.
So, I downloaded x64 GLFW from github and used vc2022
folder to link with.
I set my Runtime Library to /MTx
(Debug → /MTd
; Release → /MT
), added opengl32.lib
and glfw3_mt.lib
to the linker and compiled the project.
Well, everything went fine, except there is the issue:
warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
Output from the compilation (Debug x64) (shortened for clarity):
CL.exe /c /ZI /JMC /W3 /WX- /sdl /Od /D _DEBUG /Gm- /EHsc /RTC1 /MTd /GS /Gd /TP /FC src\main.cpp
Output from the linking step (Debug x64) (shortened for clarity):
link.exe /OUT:"D:\Path\build\x64\Debug\Project_64_d.exe" /INCREMENTAL /LIBPATH:"D:\Path\lib" opengl32.lib glfw3_mt.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /DEBUG /SUBSYSTEM:CONSOLE /DYNAMICBASE /MACHINE:X64 build\intermediate\x64\Debug\glad.obj