Closed marbx closed 9 months ago
cancel is defined in connection.hpp, a header only file. There is no need for a library. The problem is that connection.hpp is not read, so the linker must assume it is in a library.
g++ -H
shows that compiler reads 5 redis related files, namely:
/home/marbx/boost/install/include/boost/redis/logger.hpp
/home/marbx/boost/install/include/boost/redis/detail/connector.hpp
/home/marbx/boost/install/include/boost/redis/detail/resolver.hpp
/home/marbx/boost/install/include/boost/redis/detail/handshaker.hpp
/home/marbx/boost/install/include/boost/redis/usage.hpp
So the question is why the compiler does not read
/home/marbx/boost/install/include/boost/redis/connection.hpp
File permissions are regular
Hi, there are some problems building with cmake in the master branch. I have made some fixes in the develop though. This should work
# Clone the superproject (perhaps using shallow copies)
$ git clone --recurse-submodules https://github.com/boostorg/boost
# Checkout the develop branch
$ git submodule foreach --recursive git checkout develop
# Do an out of source build
$ mkir build
$ cmake ../boostorg/libs/redis
$ cmake --build . --target cpp20_intro
Let me know if this works for you.
cancel is defined in connection.hpp, a header only file. There is no need for a library. The problem is that connection.hpp is not read, so the linker must assume it is in a library.
You need to build the library yourself by including #include <boost/redis/src.hpp>
in one cpp file, it can be the one where you define the main function.
Adding #include <boost/redis/src.hpp>
to example/cpp17_intro.cpp results in 0 errors and a nice and cozy PING: Hello world
:-)
Excellent!
Thank you a lot. Looking forward to continue from here, and to look into cloning the superproject, too.
Closing the issue, because the README already contains the advise. I just overlooked it.
Hi, there are some problems building with cmake in the master branch. I have made some fixes in the develop though. This should work
# Clone the superproject (perhaps using shallow copies) $ git clone --recurse-submodules https://github.com/boostorg/boost # Checkout the develop branch $ git submodule foreach --recursive git checkout develop # Do an out of source build $ mkir build $ cmake ../boostorg/libs/redis $ cmake --build . --target cpp20_intro
Let me know if this works for you.
@mzimbres , yes, this worked out fine and I executed
$ example/cpp20_intro
PING: Hello world
I like this out-of-source-build path, I now only have to better understand cmake :-)
Hello, because the Debian 12 Boost package
libboost-all-dev
does not include Redis, I "bootstrapped" boost 1.84.0 withI can compile and run a Boost coroutine example using
When I try to run cmake, as described in the README,...
... I get many errors:
When I try to compile the Redis
cpp17_intro
example using...... I get many linker errors:
It seems I must specify a library, but there is no library called *redis* under
/home/marbx/boost/install/lib/
What am I missing? Thanks
P.S. I corrected the g++ calls because they formerly used libraries from /usr/lib/*