0

trying to compile and use 3rd party libraries in my code. It actually worked before, then I tried to move a directory and it stopped working even after reverting to . I found some related answers, but It already worked for me, so I think it shouldn't be something big. I am compiling with Visual Studio 2019. The relevant CMakeList.txt code:

if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
   message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
   file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
                  "${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(REQUIRES boost/1.70.0-7
                         protobuf/3.11.2-1
                BASIC_SETUP)
target_link_libraries(main ${CONAN_LIBS})

The error is:

fatal error LNK1104: cannot open file 'libboost_atomic-vc141-mt-sgd-x64-1_70.lib'
Nadav Barak
  • 177
  • 1
  • 3
  • 14
  • 1
    There are no details about your build, please, show your entire output, only the error message doesn't help. Your usage is correct, so it could be related to incorrect settings detected by conan x cmake. You could debug it by printing CONAN_LIBS and checking the libboost_atomic name provided by Conan. Probably is there, but using different name based on your profile. – uilianries Aug 04 '21 at 12:18
  • Also, I cannot see reference `boost/1.70.0-7` (that extra `-7`) in ConanCenter, so it might be the recipe as well. Is it possible to have a look at the recipe? – jgsogo Aug 05 '21 at 16:18

1 Answers1

0

You will need to disable automatic linking with MSVC by adding add_definitions(-DBOOST_ALL_NO_LIB) to your cmake project as mentioned here

omarekik
  • 13
  • 5