Skip to content
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

Compile failure with Boost 1.5.3 #318

Closed
abhinavpunj opened this issue Jan 19, 2022 · 4 comments
Closed

Compile failure with Boost 1.5.3 #318

abhinavpunj opened this issue Jan 19, 2022 · 4 comments

Comments

@abhinavpunj
Copy link

abhinavpunj commented Jan 19, 2022

Hi, I'm trying to build this in C++ 11 with Async and Boost, my cmake variables are cmake -DCMAKE_PREFIX_PATH="$LIBFARM" -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" -DREDIS_PLUS_PLUS_CXX_STANDARD=11 -DREDIS_PLUS_PLUS_BUILD_ASYNC=libuv -DREDIS_PLUS_PLUS_ASYNC_FUTURE=boost

I was initially getting Boost errors for unused-local_typedefs and deprecated-declarations which I was able to resolve by adding
target_compile_options(${SHARED_LIB} PRIVATE "-Wall" "-W" "-Werror" "-Wno-unused-local-typedefs" "-Wno-unused-variable" "-Wno-deprecated-declarations") to CMakeLists.txt

But since then I'm getting the following compile error at multiple places.

In file included from /home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_redis.h:20:0,
                 from /home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_redis.cpp:17:
/home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_connection.h: In instantiation of ‘void sw::redis::CommandEvent<Result, ResultParser>::set_exception(std::__exception_ptr::exception_ptr) [with Result = sw::redis::Optional<double>; ResultParser = sw::redis::DefaultResultParser<sw::redis::Optional<double> >]’:
/home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_redis.cpp:52:1:   required from here
/home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_connection.h:235:9: error: no matching function for call to ‘boost::promise<sw::redis::Optional<double> >::set_exception(std::__exception_ptr::exception_ptr&)’
         _pro.set_exception(err);
         ^~~~
In file included from /home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/future/boost/async_utils.h:23:0,
                 from /home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_connection.h:30,
                 from /home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_redis.h:20,
                 from /home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_redis.cpp:17:
/home/apunj/workplace/queryLogging/build/Redis-plus-plus/Redis-plus-plus-1.x/AL2_x86_64/DEV.STD.PTHREAD/build/private/tmp/brazil-path/build.libfarm/include/boost/thread/future.hpp:1682:14: note: candidate: void boost::promise<R>::set_exception(boost::exception_ptr) [with R = sw::redis::Optional<double>]
         void set_exception(boost::exception_ptr p)
              ^~~~~~~~~~~~~
/home/apunj/workplace/queryLogging/build/Redis-plus-plus/Redis-plus-plus-1.x/AL2_x86_64/DEV.STD.PTHREAD/build/private/tmp/brazil-path/build.libfarm/include/boost/thread/future.hpp:1682:14: note:   no known conversion for argument 1 from ‘std::__exception_ptr::exception_ptr’ to ‘boost::exception_ptr’
In file included from /home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_redis.h:20:0,
                 from /home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_redis.cpp:17:
/home/apunj/workplace/queryLogging/src/Redis-plus-plus/build/private/src/src/sw/redis++/async_connection.h: In instantiation of ‘void sw::redis::CommandEvent<Result, ResultParser>::set_exception(std::__exception_ptr::exception_ptr) [with Result = sw::redis::Optional<long long int>; ResultParser = sw::redis::DefaultResultParser<sw::redis::Optional<long long int> >]’:

Is it something to do with some a specific Boost version needed? Would appreciate some tips on fixing this

@wingunder
Copy link
Contributor

Hi @abhinavpunj,

Are you sure it's Boost 1.5.3? Did you not perhaps mean Boost 1.53.0. If so, this is really an ancient version of Boost.
I have an old Ubuntu 16.04 box that has Boost 1.58.0 installed. The almost 2 year old Ubuntu 20.04 ships with Boost 1.71.0.

So, this is just a shot in the dark, but could you maybe try to upgrade your Boost lib?

Regards

@sewenew
Copy link
Owner

sewenew commented Jan 20, 2022

@abhinavpunj You should update your boost version to at least 1.55.0. The old version is lack of an overload of template <typename E> boost::promise::set_exception(E e).

Regards

@abhinavpunj
Copy link
Author

Sorry yes I did mean Boost 1.53.0. Upgrading the Boost version to 1.59 fixed this issue. Thanks for your help! Maybe adding the minimum required Boost version in Readme (just like you have for hiredis) will be good.

@sewenew
Copy link
Owner

sewenew commented Jan 22, 2022

@abhinavpunj In fact, I was not aware of this problem until you opened this issue. I've updated the doc to mention the version requirement.

Thanks for finding this problem, and your suggestion!

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants