-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] SampleProducer terminate called after throwing an instance of 'std::regex_error' using GCC 4.8.5 #469
Comments
GCC 4.8 is no longer supported because CentOS 7 reached EOL on June 30, 2024. References:
You added the pulsar-client-cpp/CMakeLists.txt Lines 148 to 150 in bdf6854
|
Is there a workaround that I can use GCC 4.8 and INTEGRATE_VCPKG to avoid this regex_error issue? |
You can try adding the |
I added boost-regex to vcpkg.json
and migrate the code to CMakeLists.txt
cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON cmake --build build -j8 I got below error, did I miss some steps? [ 89%] Linking C executable SampleAsyncConsumerCApi |
I added
|
Search before asking
Version
pulsar client cpp 3.6.0
Minimal reproduce step
OS: CentOS Linux release 7.2
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-39)
cmake version 3.28.3
git clone https://github.com/apache/pulsar-client-cpp.git
cd pulsar-client-cpp
git checkout branch-3.6
git submodule update --init --recursive
cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON
cmake --build build -j8
cd build/examples
./SampleProducer
2024-12-26 16:13:18.877 INFO [140411963297856] ClientConnection:188 | [ -> pulsar://localhost:6650] Create ClientConnection, timeout=10000
2024-12-26 16:13:18.877 INFO [140411963297856] ConnectionPool:124 | Created connection for pulsar://localhost:6650-pulsar://localhost:6650-0
terminate called after throwing an instance of 'std::regex_error'
what(): regex_error
Aborted
What did you expect to see?
Use Boost::Regex instead of std::regex because GCC 4.8.x implementation of std::regex is buggy
What did you see instead?
terminate called after throwing an instance of 'std::regex_error'
Anything else?
I saw below in LegacyFindPackages.cmake, but it seems something not work with INTEGRATE_VCPKG.
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
# GCC 4.8.2 implementation of std::regex is buggy
set(BOOST_COMPONENTS ${BOOST_COMPONENTS} regex)
set(CMAKE_CXX_FLAGS " -DPULSAR_USE_BOOST_REGEX")
MESSAGE(STATUS "Using Boost::Regex")
elseif (CMAKE_COMPILER_IS_GNUCC)
MESSAGE(STATUS "Using std::regex")
# Turn on color error messages and show additional help with errors (only available in GCC v4.9+):
add_compile_options(-fdiagnostics-show-option -fdiagnostics-color)
endif()
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: