-
Notifications
You must be signed in to change notification settings - Fork 38
Description
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?
1. Find the package using 'find_package'
2. What paths to be added to "target_include_directories"
3. What libs are to be added to "target_link_libraries"
As said, I tried with Conan
and did "install" using the below CMakeLIsts.txt, but I ran into several LINK errors:
CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(asio_example CXX)
# Minimum C++ standard
set(CMAKE_CXX_STANDARD 20)
find_package(ASIO-GRPC REQUIRED)
add_executable(${PROJECT_NAME} src/file-transfer-server.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE asio-grpc::asio-grpc )
Install command
conan install . --output-folder=build --build=missing -s compiler.cppstd=20
LINK Errors
libprotobuf-lite.lib(libprotobuf-lite.dll) : error LNK2005: "public: virtual __cdecl google::protobuf::io::StringOutputStream::~StringOutputStream(void)" (??1Str
ingOutputStream@io@protobuf@google@@UEAA@XZ) already defined in libprotobuf.lib(message_differencer.obj) [C:\Users\thavi\.conan2\p\b\grpc67bcbddea9216\b\bu
ild\grpc_ruby_plugin.vcxproj]
libprotobuf.lib(libprotobuf.dll) : error LNK2005: "public: bool __cdecl google::protobuf::ServiceDescriptor::GetSourceLocation(struct google::protobuf::SourceLoc
ation *)const " (?GetSourceLocation@ServiceDescriptor@protobuf@google@@QEBA_NPEAUSourceLocation@23@@Z) already defined in libprotobuf.lib(descriptor.obj) [C:\Use
rs\thavi\.conan2\p\b\grpc67bcbddea9216\b\build\grpc_ruby_plugin.vcxproj]
libprotobuf.lib(libprotobuf.dll) : error LNK2005: "public: class google::protobuf::Descriptor const * __cdecl google::protobuf::MethodDescriptor::input_type(void
)const " (?input_type@MethodDescriptor@protobuf@google@@QEBAPEBVDescriptor@23@XZ) already defined in libprotobuf.lib(descriptor.obj) [C:\Users\thavi\.conan
2\p\b\grpc67bcbddea9216\b\build\grpc_ruby_plugin.vcxproj]
libprotobuf.lib(libprotobuf.dll) : error LNK2005: "public: class google::protobuf::Descriptor const * __cdecl google::protobuf::MethodDescriptor::output_type(voi
d)const " (?output_type@MethodDescriptor@protobuf@google@@QEBAPEBVDescriptor@23@XZ) already defined in libprotobuf.lib(descriptor.obj) [C:\Users\thavi\.con
an2\p\b\grpc67bcbddea9216\b\build\grpc_ruby_plugin.vcxproj]
libprotobuf.lib(libprotobuf.dll) : error LNK2005: "public: bool __cdecl google::protobuf::MethodDescriptor::GetSourceLocation(struct google::protobuf::SourceLoca
tion *)const " (?GetSourceLocation@MethodDescriptor@protobuf@google@@QEBA_NPEAUSourceLocation@23@@Z) already defined in libprotobuf.lib(descriptor.obj) [C:\Users
\thavi\.conan2\p\b\grpc67bcbddea9216\b\build\grpc_ruby_plugin.vcxproj]
libprotobuf.lib(libprotobuf.dll) : error LNK2005: "public: bool __cdecl google::protobuf::FileDescriptor::GetSourceLocation(class std::vector<int,class std::allo
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