Relative Content

Tag Archive for c++visual-studiocmake

Why does cmake throw LNK2019 even though the proper .lib file is linked?

I’m trying to create an API wrapper for Discord’s GameSDK using Node’s addon api and cmake-js. My code makes calls to Discord’s libraries using their provided header files. However, I keep getting LNK2019 errors when trying to compile, even though the correct .lib file for my architecture is passed to the linker.

How to properly generate a CMake project for Visual Studio

When I configure the CMake project with the Visual Studio generator it generates the Visual Studio solution. In the solution in the explorer I can see the CMakeLists.txt, and if it changes Visual Studio detects it, and asks to reload the entire solution, so far so good. However it doesn’t seem to be a proper CMake solution as you would get if you go to new project and select a new CMake project from Visual Studio itself. A whole bunch options are missing in the context menus when you right click:

How can I replace the default /MTd with /MTd in cmake?

I am trying to have my exe use /MTd instead of the default /MTd, but when I generate my project, it will still have /MDd in the Code Generation and Command Line when looking at the TestFlags property page. I have tried both a string replace and a set for CMAKE_CXX_FLAGS_DEBUG . Is there something that I am missing?