
Dear Boost::regex_icu users! I've ran into a problem while using the regex library of Boost with ICU compatibility mode. I am getting a lot of linker errors about ICU functions. This is all the linker errors I get: https://pastebin.com/eCj8Pi2m I am pretty sure that I'm getting this while using `boost::u32regex_token_iterator`. I'm using CMake to build my project and CPM (A wrapper around FetchContent). Here is my CMakeLists.txt: ``` cmake_minimum_required(VERSION 3.12) project(termeszetes_nyelvi) include(cmake/CPM.cmake) set(CMAKE_CXX_STANDARD 26) set(BOOST_REGEX_STANDALONE ON) set(ICU_ROOT "C:/Program Files/icu") CPMAddPackage("gh:boostorg/regex#boost-1.89.0") add_executable(termeszetes_nyelvi main.cpp regex_utils/regex_match_collector.hpp regex_utils/split_string_using_regex.hpp print_utils/format_map.hpp) target_link_libraries(termeszetes_nyelvi PRIVATE Boost::regex_icu)``` I have tried linking to all ICU components, but it did not resolve my errors. This is the function template that causes the error: https://gist.github.com/nevemlaci/3a1a14516626b263f11e887f9433cfd4 Please tell me if you need any more details. Thank you in advance, Laci

On 10/09/2025 22:21, Lipódi László via Boost-users wrote:
Dear Boost::regex_icu users!
I've ran into a problem while using the regex library of Boost with ICU compatibility mode. I am getting a lot of linker errors about ICU functions. This is all the linker errors I get: https://pastebin.com/eCj8Pi2m I am pretty sure that I'm getting this while using `boost::u32regex_token_iterator`.
I'm using CMake to build my project and CPM (A wrapper around FetchContent).
Here is my CMakeLists.txt:
``` cmake_minimum_required(VERSION 3.12) project(termeszetes_nyelvi)
include(cmake/CPM.cmake)
set(CMAKE_CXX_STANDARD 26) set(BOOST_REGEX_STANDALONE ON)
set(ICU_ROOT "C:/Program Files/icu")
CPMAddPackage("gh:boostorg/regex#boost-1.89.0")
add_executable(termeszetes_nyelvi main.cpp regex_utils/regex_match_collector.hpp regex_utils/split_string_using_regex.hpp print_utils/format_map.hpp) target_link_libraries(termeszetes_nyelvi PRIVATE Boost::regex_icu)```
I have tried linking to all ICU components, but it did not resolve my errors.
Your linker error is definitely from ICU: I believe the first of the errors relates to the contents of icuin.dll linked to via icuin.lib. However, I know nothing about CMake so your problem likely comes from there... John.

Hi John! Thank you for your answer! I've just got the setup working. CMake selected some of the ICU libraries from the WinSDK instead of my other ICU install... After looking into it, the WinSDK only comes with a stripped down version of ICU, so there is where the linker errors were coming from. I had to nuke my CMakeCache a couple of times and use a newer version of CMake where I could specify the ICU_ROOT variable to select where ICU was located. Laci -------- Eredeti üzenet -------- 2025. 09. 11. 18:40-kor, John Maddock via Boost-users<boost-users@lists.boost.org> ezt írta:
Your linker error is definitely from ICU: I believe the first of the errors relates to the contents of icuin.dll linked to via icuin.lib. However, I know nothing about CMake so your problem likely comes from there...
John.
participants (2)
-
John Maddock
-
Lipódi László