Do you use the exact same include files? ::grpc::Server shouldn't be 
incomplete if you are including the header files that we use.

On Tuesday, September 4, 2018 at 1:39:27 PM UTC-7, Alistair Lowe wrote:
>
> Hi guys,
>
> I'm currently trying to implement an async server in C++ 14, loosely 
> following the example provided in 
> https://github.com/grpc/grpc/blob/v1.14.1/examples/cpp/helloworld/greeter_async_server.cc
>
> In my class equivalent to ServerImpl in the example, I have the member: '
> std::unique_ptr<grpc::Server> server;', just as the ServerImpl has the 
> member 'std::unique_ptr<Server> server_;'
>
> However when I compile I receive the following error, triggered by the 
> presence of the server member variable: 
>
> [build] /usr/include/c++/7/bits/unique_ptr.h: In instantiation of ‘void 
> std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = grpc::Server]’:
> [build] /usr/include/c++/7/bits/unique_ptr.h:268:17: required from 
> ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = grpc::Server; _Dp = 
> std::default_delete<grpc::Server>]’
> [build] 
> /home/developer/open-iot-server/deployment-management-controller/grpc_server.hpp:50:9:
>  
> required from here
> [build] /usr/include/c++/7/bits/unique_ptr.h:76:22: error: invalid 
> application of ‘sizeof’ to incomplete type ‘grpc::Server’
> [build] static_assert(sizeof(_Tp)>0,
> [build] ^
>
> I'm relatively new to modern C++ as I've come from an embedded background 
> where C++ 03 is still common-place, so my apologies in advance if this is 
> more a misunderstanding of the correct usage of uniqe_ptr.
>
> Any support/advice would be much appreciated.
>
> Many thanks,
> Alistair
>

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/6e2a18ff-4c51-4781-ae2c-b02a54cde781%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to