0

In my CMakeLists.txt file, I have this:

# Locate Boost date_time library
set(PROGRAM_FILES "Program Files")
set(Boost_INCLUDE_DIR C:/${PROGRAM_FILES})
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.58 REQUIRED COMPONENTS date_time)

I have my boost directory located at C:\Program Files\boost and in that directory there is a date_time directory and a date_time.hpp header file.

My error:

Error       
CMake Error at 
C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):

  Could NOT find Boost (missing: date_time) (found suitable version "1.72.0",
  minimum required is "1.58")   C:/Program Files (x86)/Microsoft Visual Studio/2019/Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake    137
westandy
  • 1,360
  • 2
  • 16
  • 41
Trajan
  • 1,380
  • 6
  • 20
  • 41
  • The error is about not finding the Boost. Do you have the Boost installed? If so, where have you installed it? – Tsyvarev Oct 04 '19 at 16:39
  • @Tsyvarev I have Visual Studio. how can i find out? – Trajan Oct 04 '19 at 16:42
  • 1
    Visual Studio will not tell you anything about whether Boost is installed on your system. You need to install it yourself. I suggest you read through [this](https://www.boost.org/doc/libs/1_71_0/more/getting_started/windows.html) page, which explains how to get started with Boost (including unzipping and building Boost). – Kevin Oct 04 '19 at 16:49
  • @squareskittles but when you download visual studio it gives you the option for additional packages. I think i clicked the boost option. – Trajan Oct 04 '19 at 16:49
  • Did you install it with the Nuget package manager within Visual Studio? – Kevin Oct 04 '19 at 16:56
  • @squareskittles i thought so yes – Trajan Oct 04 '19 at 17:21
  • 1
    It will be really hard to help with so little information. I think I can find another question that had the same problem but with so little knowledge about your setup it may not be accurate – Guillaume Racicot Oct 04 '19 at 18:11
  • Possible duplicate: https://stackoverflow.com/q/54581717/2104697 – Guillaume Racicot Oct 04 '19 at 18:14

0 Answers0