I am trying to use IUP to create a gui program in Windows 10. I am also using Clion+MSVC as an IDE. IUP has both .lib and .dll files for download and all goes well when I don't specify how to link in cmake; cmake automatically tries to link dynamically with iup.dll when there are no custom flags about linking.
However, when I try to statically link iup.dll with a compiler flag /MT
, the compiler automatically changes /MT
to /MD
and just link dynamically.
Here's the cmake code I used to force compiler static linking:
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT")
and then I get this warning:
cl : Command line warning D9025 : overriding '/MT' with '/MD'
Any way to "force" cmake and compiler to statically link library to my program?