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

simple program stuck #102

Closed
JaydenFish opened this issue Jun 19, 2024 · 2 comments
Closed

simple program stuck #102

JaydenFish opened this issue Jun 19, 2024 · 2 comments

Comments

@JaydenFish
Copy link

JaydenFish commented Jun 19, 2024

#define AGRPC_BOOST_ASIO
#define AGRPC_UNIFEX
#include <agrpc/asio_grpc.hpp>

int main(int argc, char *argv[], char *envp[])
{
    agrpc::GrpcContext grpc_context;
    return 0;
}

run with g++ -Iinclude -lgrpc++ -lgrpc_unsecure -labsl_synchronization -o test_agrpc main/test_agrpc.cpp && ./test_agrpc, it stuck.
but run with g++ -Iinclude -lgrpc++ -labsl_synchronization -o test_agrpc main/test_agrpc.cpp && ./test_agrpc , it is ok.
looks have something wrong with -lgrpc_unsecure
my enviroment is gcc 14.1.1 fedora 41 @agrpc v3.1.0@6cee405b

@Tradias
Copy link
Owner

Tradias commented Jun 19, 2024

You may not mix grpc++ and grpc_unsecure within one application. This is a limitation of gRPC. In other words, remove -lgrpc++ and -lgrpc_unsecure from the first command line, add only -lgrpc++_unsecure.

See #61

And grpc/grpc#24422 (comment)

@Tradias
Copy link
Owner

Tradias commented Jun 19, 2024

Btw if you prefer to set things up with CMake, there is an example on how to consume system installed gRPC with pkgconfig from CMake: #60 (comment)

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

2 participants