LibTorch and OpenCV Libs not working in same cmakelist file
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(Detect)
#set(Torch &quot;/home/somnath/libtorch/share/cmake/Torch&quot;)
find_package(Torch REQUIRED)
find_package(OpenCV REQUIRED)
message(STATUS &quot;CVINCLUDE: ${OpenCV_INCLUDE_DIRS}&quot;)
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(Detect main.cpp)
target_link_libraries(Detect  ${TORCH_LIBRARIES}; ${OpenCV_LIBS})

${TORCH_LIBRARIES}; ${OpenCV_LIBS} both are not working at the same time if want to use to build the code.
enter image description here

Try to change the libTorch from Pre-cxx11 ABI to cxx11 ABI
https://pytorch.org/get-started/locally/
All thanks to Jacob HM from
https://stackoverflow.com/a/61459156/13045595
