cpp-best-practices / gui_starter_template

A template CMake project to get you started with C++ and tooling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease'

tagsemb opened this issue · comments

commented

Sorry if this is a stupid question, but I can't for the life of me figure out how to fix this CRT linker issue. My test_nana executable and my Nana lib cannot agree on run-time libraries.

I've used a template to set up a new project, removed all frameworks except Nana, and set up using MSVC build. The problem is that there seems to be conflicting link types between the Nana example executable and the Nana lib. I cannot remember actively choosing either link type. Can this be specified in the project somewhere, or are these settings magically lifted from elsewhere?

It does appear to be mentioning a triplet from vcpkg for whatever reason, even though the project does not use vcpkg as far as I can tell?

I've tried changing the CMAKE_CACHE_ARGS "-DNANA_CMAKE_SHARED_LIB:BOOL=TRUE" to FALSE in the nana\CMakeLists.txt file, but it doesn't seem to make a difference.

  Building Custom Rule D:/Code/github/nana_test/test/CMakeLists.txt
  Using triplet "x64-windows" from "D:\Code\vcpkg\installed\x64-windows\"
  constexpr_tests.cpp
  relaxed_constexpr_tests.vcxproj -> D:\Code\github\nana_test\build\test\Release\relaxed_constexpr_tests.exe
  Building Custom Rule D:/Code/github/nana_test/src/nana/CMakeLists.txt
  Using triplet "x64-windows" from "D:\Code\vcpkg\installed\x64-windows\"
  main.cpp
nana.lib(basis.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in main.obj [D:\Code\github\nana_test\build\src\nana\test_nana.vcxproj]
nana.lib(events_operation.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in main.obj [D:\Code\github\nana_test\build\src\nana\test_nana.vcxproj]
nana.lib(programming_interface.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in main.obj [D:\Code\github\nana_test\build\src\nana\test_nana.vcxproj]
nana.lib(widget.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MD_DynamicRelease' in main.obj [D:\Code\github\nana_test\build\src\nana\test_nana.vcxproj]

I've since removed the test_nana executable because I could not get it consistently working on all platforms. I'm going to close this bug report, but will re-integrate nana in the future if I can.