I am facing the same linker error:

undefined reference to 
`grpc::Timepoint2Timespec(std::chrono::time_point<std::chrono::_V2::system_clock,
 
std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, 
gpr_timespec*)'
collect2: error: ld returned 1 exit status

Previously it was working fine when my code was on following version of 
Linux:

Linux 2.6.32-504.63.3.el6.x86_64

Then I moved my code to another machine, where I started facing the linker 
error. Linux version of new machine:

Linux 3.10.0-514.26.2.el7.x86_64

Any idea if there is any difference in behavior of CMake on these 2 
versions of Linux?
Thank you in advance!!

On Wednesday, 28 September 2016 05:11:41 UTC+5:30, Masood Malekghassemi 
wrote:
>
> Unfortunately our CMake support is still 'experimental'. If you do find 
> specifically what's breaking for you and file a bug on whatever flags are 
> missing wherever and such, we'd appreciate it! Until we're past 
> 'experimental' support, all I can suggest is to use vanilla make or to dig 
> deep: like checking the symbols in the compiled object files, maybe see if 
> anything's missing from them, look through #defines and see if your system 
> isn't getting properly autoconfigured for by the preprocessor at 
> compilation time, or even files containing the missing symbols themselves 
> missing from commands spat out during a verbose build process. We'd like to 
> know what's gone wrong as well.
>
> On Tuesday, September 20, 2016 at 5:11:43 AM UTC-7, Okke Hendriks wrote:
>>
>>
>> In function 
>> `grpc::TimePoint<std::chrono::time_point<std::chrono::_V2::system_clock, 
>> std::chrono::duration<long, std::ratio<1l, 1000000000l> > > 
>> >::TimePoint(std::chrono::time_point<std::chrono::_V2::system_clock, 
>> std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&)':
>> prototype_a.cpp:(.text._ZN4grpc9TimePointINSt6chrono10time_pointINS1_3_V212system_clockENS1_8durationIlSt5ratioILl1ELl1000000000EEEEEEEC2ERKS9_[_ZN4grpc9TimePointINSt6chrono10time_pointINS1_3_V212system_clockENS1_8durationIlSt5ratioILl1ELl1000000000EEEEEEEC5ERKS9_]+0x1f):
>>  
>> undefined reference to `grpc::Timepoint2Timespec(std::chrono::time_point<
>> std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l
>> , 1000000000l> > > const&, gpr_timespec*)'
>> collect2: error: ld returned 1 exit status
>>
>> I am getting the above linker error when adding the following lines to my 
>> 'procom' library.
>>
>> std::chrono::system_clock::time_point 
>> deadline(std::chrono::system_clock::now() + std::chrono::seconds(10));
>> _channel->WaitForConnected(deadline);
>>
>> I am linking 'procom' with the following CMake commands:
>>
>> add_library(procom SHARED src/procom.cpp)
>> target_link_libraries(procom pthread ${ZLIB_LIBRARIES} libgpr.a libgrpc++
>> _unsecure.a libgrpc_unsecure.a libprotobuf.a)
>>
>> Which I am using later on in a 'prototype_a' application, which is being 
>> build with the following CMake commands:
>>
>> add_executable(proto_a src/prototype/prototype_a.cpp)
>> target_link_libraries(proto_a procom)
>>
>> I would appreciate it very much if someone has an idea of what I am doing 
>> wrong? :)
>> Thank you in advance!
>>
>

-- 
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/d6a07ff3-3cb1-407b-ab7b-5b2614f8a974%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to