• Scientific Computing | SciVision

  • Blog
  • Tags
  • Categories

Specify C and CXX for CMake projects with MSVC

18 February, 2020

A quirk with Visual Studio and CMake for C++ projects is that the C language must also be specified in CMakeLists.txt like:

project(foo LANGUAGES C CXX)

Otherwise, weird linker errors can occur, even on a pure C++ project with no C files.

  • CMake
  • Visual Studio