У меня установлен vcpkg 2025-09-03 и установлен CMake 4.1.2.
Теперь я хочу установить Boost Date-Time
.\vcpkg.exe install boost-date-time
И проверьте, установлен ли boost-date-time.
PS C:\Users\negrå\Documents\GitHub\vcpkg> . \ v c p k g . e x e l i s t < b r / > a b s e i l : x 6 4 - w i n d o w s 2 0 2 5 0 5 1 2 . 1 A b s e i l i s a n o p e n - s o u r c e c o l l e c t i o n o f C + + l i b r a . . . < b r / > b o o s t - a l g o r i t h m : x 6 4 - w i n d o w s 1 . 8 9 . 0 B o o s t a l g o r i t h m m o d u l e < b r / > b o o s t - a l i g n : x 6 4 - w i n d o w s 1 . 8 9 . 0 B o o s t a l i g n m o d u l e < b r / > b o o s t - a r r a y : x 6 4 - w i n d o w s 1 . 8 9 . 0 B o o s t a r r a y m o d u l e < b r / > b o o s t - a s s e r t : x 6 4 - w i n d o w s 1 . 8 9 . 0 B o o s t a s s e r t m o d u l e < b r />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
Когда я добавляю это в свой 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()
Затем я запускаю cmake и vcpkg
C:\Users\negrå\Documents\GitHub\MicroSoft> cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=C:\\Users\\negrå\\Documents\\GitHub\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake
Я понимаю. Все остальное находит, кроме этого
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)
Вопрос
Что делать, если я получаю сообщение Не удалось найти файл конфигурации пакета, предоставленный "boost_date_time", и я устанавливаю boost-date-time с помощью vcpkg?
Изменить
Даже если я включу все библиотеки Boost, это не выдаст ошибок при построении кеша.
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()
При компиляции все равно возникает ошибка...
error C1083: Cannot open include file: 'boost/date_time/posix_time/posix_time.hpp':
Подробнее здесь: https://stackoverflow.com/questions/797 ... sing-vcpkg
Как мне найти Boost date_time в CMake с помощью vcpkg? ⇐ C++
Программы на C++. Форум разработчиков
-
Anonymous
1760640385
Anonymous
У меня установлен vcpkg 2025-09-03 и установлен CMake 4.1.2.
Теперь я хочу установить Boost Date-Time
.\vcpkg.exe install boost-date-time
И проверьте, установлен ли boost-date-time.
PS C:\Users\negrå\Documents\GitHub\vcpkg> . \ v c p k g . e x e l i s t < b r / > a b s e i l : x 6 4 - w i n d o w s 2 0 2 5 0 5 1 2 . 1 A b s e i l i s a n o p e n - s o u r c e c o l l e c t i o n o f C + + l i b r a . . . < b r / > b o o s t - a l g o r i t h m : x 6 4 - w i n d o w s 1 . 8 9 . 0 B o o s t a l g o r i t h m m o d u l e < b r / > b o o s t - a l i g n : x 6 4 - w i n d o w s 1 . 8 9 . 0 B o o s t a l i g n m o d u l e < b r / > b o o s t - a r r a y : x 6 4 - w i n d o w s 1 . 8 9 . 0 B o o s t a r r a y m o d u l e < b r / > b o o s t - a s s e r t : x 6 4 - w i n d o w s 1 . 8 9 . 0 B o o s t a s s e r t m o d u l e < b r />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
Когда я добавляю это в свой 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()
Затем я запускаю cmake и vcpkg
C:\Users\negrå\Documents\GitHub\MicroSoft> cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=C:\\Users\\negrå\\Documents\\GitHub\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake
Я понимаю. Все остальное находит, кроме этого
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)
[b]Вопрос[/b]
Что делать, если я получаю сообщение Не удалось найти файл конфигурации пакета, предоставленный "boost_date_time", и я устанавливаю boost-date-time с помощью vcpkg?
[b]Изменить[/b]
Даже если я включу все библиотеки Boost, это не выдаст ошибок при построении кеша.
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()
При компиляции все равно возникает ошибка...
error C1083: Cannot open include file: 'boost/date_time/posix_time/posix_time.hpp':
Подробнее здесь: [url]https://stackoverflow.com/questions/79792434/how-do-i-find-boost-date-time-in-cmake-by-using-vcpkg[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия