-
Notifications
You must be signed in to change notification settings - Fork 34
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
Need some basic help! #97
Comments
Hi, thanks for your detailed report. I personally do not use conan but I have a little project where I smoketest asio-grpc with conan. Using default setting with MSVC it builds static libraries for me, for you it seems like you have selected shared libraries (at least for protobuf) and now tries to link with both Here is the
After running the conan install command, I do
|
Thank you so much @Tradias for your quick response! I followed the below instructions of the README.md, and it was successful in installing the library. In stage 2, where I wanted to integrate the library to my target. Here is the snippet of CMakeLists.txt that builds my target linking asio-grpc:
After configuring my CMakeLists.txt, when I build it, I get the below error:
Primarily the issue is about missing "use_awaitable_t"... not clear if my verion of Boost::asio (1.75) is missing it perhaps? Other general question: Thanks for your help in advance! Thanks, |
In the long run I highly recommend using a package manager. At work and personally I use vcpkg. I assume in your CMake you forgot to add: target_compile_features(WT PRIVATE cxx_std_20) Specifying a target in Also at some point you will have to generate source code from asio_grpc_protobuf_generate(
GENERATE_GRPC
TARGET WT
OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated"
IMPORT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/proto"
PROTOS "${CMAKE_CURRENT_SOURCE_DIR}/proto/helloworld/helloworld.proto") |
Thank you so much! I had a valuable learning experience with this cmake function, target_compile_features. Additionally, I proceeded with "vcpkg" as you suggested, and I must say, I found it to be incredibly user-friendly. Regarding the linking errors, you were absolutely correct! When I replaced cxx_std_17 with cxx_std_20 in the code below, the issues were resolved:
With that, I could "configure" (
I was wondering if you could provide guidance on this as well? Thanks for your help, in advance. Thanks, |
Here is a complete minimal gRPC helloworld example: https://github.com/Tradias/example-vcpkg-grpc/tree/asio-grpc-97 The The protobuf error is this one protocolbuffers/protobuf#8688 and was fixed in a later protobuf release. Again, none issue if you use my example. |
@Tradias : The minimal gRPC "helloworld" example worked seamlessly! Interestingly, while examining that example, I gained insights into certain concepts related to both CMake and VCPKG as well :) I truly appreciate your guidance throughout this process. BTW, I've successfully upgraded my Boost version to the latest release (1.84.0). However, upon attempting to integrate the success into my production application, I encountered the following linking error: It has been quite perplexing, and I've spent a significant amount of time troubleshooting since yesterday. I understand that I've already taken your valuable time, so if you have a chance to provide any insight or guidance into this error, I'd be grateful. Otherwise, no worries; I sincerely appreciate all the assistance you've provided thus far. You are the best!
Here is the complete list of .obj files that have linking problem due to missing the exact sample symbol: grpc_unsecure.lib(bdp_estimator.cc.obj)
grpc_unsecure.lib(stream_map.cc.obj)
grpc_unsecure.lib(server.cc.obj
grpc_unsecure.lib(dns_resolver_ares.cc.obj)
grpc_unsecure.lib(channel_idle_filter.cc.obj)
grpc_unsecure.lib(round_robin.cc.obj)
grpc_unsecure.lib(flow_control.cc.obj)
Thanks, |
@Tradias : Sorry to bother you. This issue has become a roadblock for me. I tried on another project too, but I ran into exactly the same issue. I looked at your [Documentation] (https://tradias.github.io/asio-grpc/md_doc_v3_migration.html) and I tried like this, but with no luck: set(ASIO_GRPC_DISABLE_AUTOLINK on)
find_package(asio-grpc)
find_package(gRPC)
target_link_libraries(your_app PUBLIC asio-grpc::asio-grpc gRPC::grpc++_unsecure)
I am unable to proceed and got stuck for almost 2 days! Any quick help will be really appreciated. Thanks, |
It very much sounds like a gRPC issue, I don't think I am the right person to help here. I suspect it has something to do with the flags you used when compiling gRPC, maybe a mix of set(ASIO_GRPC_DISABLE_AUTOLINK on)
find_package(asio-grpc)
find_package(gRPC)
target_link_libraries(your_app PUBLIC asio-grpc::asio-grpc gRPC::grpc++) |
Sure, thank you, @Tradias. I will dig further into this. Thanks, |
Hi,
Firstly, I want to express my gratitude to the team for their outstanding work on this project. Over the past three years, I've had the pleasure of successfully utilizing Boost::Beast, which has given me a deep appreciation for the power of ASIO. Additionally, I've been intrigued by the potential of integrating gRPC into my projects, but I've found it challenging due to my lack of confidence in the build process. To address this, I took the initiative to learn tools such as CMake, Conan, and a bit of Bazel.
Your work has particularly caught my attention because it combines the strengths of both ASIO and gRPC. I've spent several days attempting to integrate it into my projects using both CMake and Conan, but unfortunately, I haven't had much success. Despite this setback, I'm determined not to give up.
I'm seeking your advice on how frameworks like this can be more easily integrated. Perhaps there's a secret sauce that I'm missing, and I'm struggling to identify where I can learn more about it.
For instance, my goal is to develop a C++ server using asio-grpc to serve clients written in PHP and Python, seamlessly exchanging protobuf messages. I'm also interested in creating a trimmed version of my server, which currently relies on Boost::Beast.
Given these use cases, the codebase appears somewhat daunting to me. Could you please provide guidance on the steps involved in building this library as a standalone component, enabling me to integrate it into my project effortlessly?
As said, I tried with
Conan
and did "install" using the below CMakeLIsts.txt, but I ran into several LINK errors:CMakeLists.txt
Install command
LINK Errors
Apologies for any inconvenience caused, but I'm genuinely eager to learn and gain knowledge about the build process, particularly because I'm enthusiastic about utilizing this library. So whatever guidance and pointers you could give, i will be really grateful to you.
Thanks,
Tharma
The text was updated successfully, but these errors were encountered: