I have vcpkg 2025-09-03 installed and CMake 4.1.2 installed.
Now I want to install Boost Date-Time
.\vcpkg.exe install boost-date-time
And check if boost-date-time is installed.
PS C:\Users\negrå\Documents\GitHub\vcpkg> .\vcpkg.exe list
abseil:x64-windows 20250512.1 Abseil is an open-source collection of C++ libra...
boost-algorithm:x64-windows 1.89.0 Boost algorithm module
boost-align:x64-windows 1.89.0 Boost align module
boost-array:x64-windows 1.89.0 Boost array module
boost-assert:x64-windows 1.89.0 Boost assert module
boost-atomic:x64-windows 1.89.0 Boost atomic module
boost-bind:x64-windows 1.89.0 Boost bind module
boost-cmake:x64-windows 1.89.0 Boost cmake module
boost-concept-check:x64-windows 1.89.0 Boost concept_check module
boost-config:x64-windows 1.89.0 Boost config module
boost-container-hash:x64-windows 1.89.0 Boost container_hash module
boost-container:x64-windows 1.89.0 Boost container module
boost-conversion:x64-windows 1.89.0 Boost conversion module
boost-core:x64-windows 1.89.0 Boost core module
boost-date-time:x64-windows 1.89.0 Boost date_time module
boost-describe:x64-windows 1.89.0 Boost describe module
boost-detail:x64-windows 1.89.0 Boost detail module
boost-exception:x64-windows 1.89.0 Boost exception module
boost-filesystem:x64-windows 1.89.0 Boost filesystem module
boost-function-types:x64-windows 1.89.0 Boost function_types module
boost-function:x64-windows 1.89.0 Boost function module
boost-functional:x64-windows 1.89.0 Boost functional module
boost-fusion:x64-windows 1.89.0 Boost fusion module
boost-headers:x64-windows 1.89.0 Boost headers module
boost-intrusive:x64-windows 1.89.0 Boost intrusive module
boost-io:x64-windows 1.89.0 Boost io module
boost-iterator:x64-windows 1.89.0 Boost iterator module
boost-lexical-cast:x64-windows 1.89.0 Boost lexical_cast module
boost-move:x64-windows 1.89.0 Boost move module
boost-mp11:x64-windows 1.89.0 Boost mp11 module
boost-mpl:x64-windows 1.89.0 Boost mpl module
boost-numeric-conversion:x64-windows 1.89.0 Boost numeric_conversion module
boost-optional:x64-windows 1.89.0 Boost optional module
boost-predef:x64-windows 1.89.0 Boost predef module
boost-preprocessor:x64-windows 1.89.0 Boost preprocessor module
boost-range:x64-windows 1.89.0 Boost range module
boost-regex:x64-windows 1.89.0 Boost regex module
boost-scope:x64-windows 1.89.0 Boost scope module
boost-smart-ptr:x64-windows 1.89.0 Boost smart_ptr module
boost-static-assert:x64-windows 1.89.0 Boost static_assert module
boost-system:x64-windows 1.89.0 Boost system module
boost-throw-exception:x64-windows 1.89.0 Boost throw_exception module
boost-tokenizer:x64-windows 1.89.0 Boost tokenizer module
boost-tuple:x64-windows 1.89.0 Boost tuple module
boost-type-traits:x64-windows 1.89.0 Boost type_traits module
boost-typeof:x64-windows 1.89.0 Boost typeof module
boost-uninstall:x64-windows 1.89.0 Internal vcpkg port used to uninstall Boost
boost-unordered:x64-windows 1.89.0 Boost unordered module
boost-utility:x64-windows 1.89.0 Boost utility module
boost-variant2:x64-windows 1.89.0 Boost variant2 module
boost-winapi:x64-windows 1.89.0 Boost winapi module
When I add this to my CMakeList.txt
find_package(Boost CONFIG REQUIRED COMPONENTS date_time)
if (Boost_FOUND)
message(STATUS "Boost date time library found")
target_link_libraries(GoobySoft PRIVATE Boost::date_time)
else()
message(FATAL_ERROR "Boost date time library not found")
endif()
Then I run with cmake and vcpkg
C:\Users\negrå\Documents\GitHub\MicroSoft> cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=C:\\Users\\negrå\\Documents\\GitHub\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake
I get this. Everything else it finds, but not this
CMake Error at C:/Users/negrå/Documents/GitHub/vcpkg/scripts/buildsystems/vcpkg.cmake:900 (_find_package):
Could not find a package configuration file provided by "boost_date_time"
(requested version 1.89.0) with any of the following names:
boost_date_timeConfig.cmake
boost_date_time-config.cmake
Add the installation prefix of "boost_date_time" to CMAKE_PREFIX_PATH or
set "boost_date_time_DIR" to a directory containing one of the above files.
If "boost_date_time" provides a separate development package or SDK, be
sure it has been installed.
Call Stack (most recent call first):
C:/Users/negrå/Documents/GitHub/vcpkg/installed/x64-windows/share/boost/BoostConfig.cmake:67 (find_package)
C:/Users/negrå/Documents/GitHub/vcpkg/installed/x64-windows/share/boost/BoostConfig.cmake:128 (boostcfg_find_component)
C:/Users/negrå/Documents/GitHub/vcpkg/installed/x64-windows/share/boost/vcpkg-cmake-wrapper.cmake:3 (_find_package)
C:/Users/negrå/Documents/GitHub/vcpkg/scripts/buildsystems/vcpkg.cmake:854 (include)
CMakeLists.txt:85 (find_package)
Question
What should I do if I get the message Could not find a package configuration file provided by "boost_date_time" and I have been installing boost-date-time with vcpkg?
Edit
Even if I include all Boost libraries, which gives no error when building the cache.
find_package(Boost CONFIG REQUIRED)
if (Boost_FOUND)
message(STATUS "Boost library found")
target_link_libraries(GoobySoft PRIVATE Boost)
else()
message(FATAL_ERROR "Boost library not found")
endif()
I still got the error when I compile...
error C1083: Cannot open include file: 'boost/date_time/posix_time/posix_time.hpp':
I found the answer
Installing using VCPKG manifest was not the right solution.
Installing using
.\vcpkg.exe install boost-date-time --classic
Is the solution. Now my boost-date-time is installed correctly.