I have this cmake:
cmake_minimum_required (VERSION 3.20)
project (DllTest)
if (MSVC)
add_compile_definitions(UNICODE _UNICODE)
endif()
add_library(mydll SHARED dllmain.cpp)
add_executable(test_dll testmain.cpp)
target_link_libraries(test_dll PUBLIC mydll)
when I generate projects using this cmake test file and compile the code, I am getting this error:
Error LNK1104 cannot open file 'Debug\mydll.lib'
I searched all of the build directories and I can not find any mydll.lib.
How can I create a Dll and linked it to another project using cmake?