I have same problem like:
How to link opencv and other dll files to output exe of visual studio 2013
the answer say:
There you change the extension of all the openCV libraries from .dll to .lib
i download the .lib in https://opencv.org/releases/, which have .lib in opencv\build\x64\vc15\lib
follow is my CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
set(prjName opencv_demo)
project(${prjName})
set(CMAKE_CXX_STANDARD 14)
# this is static libraries, have *.lib
set(OpenCV_DIR "C:\\opencv\\build\\x64\\vc15\\lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
find_package(OpenCV REQUIRED)
add_executable(opencv_demo main.cpp)
target_link_libraries(${prjName} PUBLIC ${OpenCV_LIBS})
but it still need dll.
i search that may cmake mt like
set_property(TARGET ${prjName} PROPERTY
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
but it still need dll.
what should i do?