When building debug mode, there was an error of MRPT. The compiler still searched for debug libraries. I found a sentence in the CMakeLists.txt
set(MRPT_DONT_USE_DBG_LIBS 1) #use release libraries for linking even if "Debug" CMake build
But it didn't work.
After a while, I found that this sentence should be above the sentence of find_package(MRPT). Please refer to
MRPTConfig
# Optional input variables:
# - (Windows only) MRPT_DONT_USE_DBG_LIBS: If defined at input, before the
# "FIND_PACKAGE(MRPT...)", and set to "1", will not search for `-dbg`
# libraries when linking in "Debug" CMake builds.
When building debug mode, there was an error of MRPT. The compiler still searched for debug libraries. I found a sentence in the CMakeLists.txt
set(MRPT_DONT_USE_DBG_LIBS
1) #use release libraries for linking even if "Debug" CMake buildBut it didn't work.
After a while, I found that this sentence should be above the sentence of
find_package(MRPT)
. Please refer to MRPTConfigThen everything works.