V6.0.1 C++ Request Reply example : undefined reference error after make -f make/makefile_RequestReplyPrimes_x64Linux4gcc7.3.0

6 posts / 0 new
Last post
Offline
Last seen: 3 years 8 months ago
Joined: 01/05/2021
Posts: 4
V6.0.1 C++ Request Reply example : undefined reference error after make -f make/makefile_RequestReplyPrimes_x64Linux4gcc7.3.0

Hello,

i encounter "undefined reference" errors when i launch the make of the C++ request reply example v6.0.1 on Linux.

NB : I don't have any problem when i launch the make of the helloworld publish-subscribe example, every thing else being the same.

Here is the command of the example that i launch.:

hello_world_request_reply]$ make -f make/makefile_RequestReplyPrimes_x64Linux4gcc7.3.0

 

Here is the output:  ( the french "référence indéfinie" stands for "undefined reference" )

Checking directory objs
Checking directory objs/x64Linux4gcc7.3.0
g++ -m64 -Wl,--no-as-needed -o objs/x64Linux4gcc7.3.0/PrimeNumberRequester objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o ojs/x64Linux4gcc7.3.0/PrimesPlugin.o objs/x64Linux4gcc7.3.0/Primes.o objs/x64Linux4gcc7.3.0/PrimesSupport.o -L/opt/rti_connextdds-6.0.1/lib/x64Linux4gcc7.3.0 -lrticonnextmsgcppz -lnddscppz -lnddscz -lnddscorez -ldl -lm -lpthread -lrt
 
objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o :
Dans la fonction « PrimeNumberRequesterExample::run_example(int, int) » :
 => PrimeNumberRequester.cxx:(.text._ZN27PrimeNumberRequesterExample11run_exampleEii[_ZN27PrimeNumberRequesterExample11run_examplEii]+0x7c) :
référence indéfinie vers « connext::RequesterParams::service_name(std::string const&) »
 => PrimeNumberRequester.cxx:(.text._ZN27PrimeNumberRequesterExample11run_exampleEii[_ZN27PrimeNumberRequesterExample11run_examplEii]+0x10e) :
référence indéfinie vers « connext::RequesterParams::qos_profile(std::string const&, std::string const&) »

objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o :
Dans la fonction « connext::details::SampleBase<PrimeNumberRequest, DDS_Writearams_t>::initialize() » :
 => PrimeNumberRequester.cxx:(.text._ZN7connext7details10SampleBaseI18PrimeNumberRequest17DDS_WriteParams_tE10initializeEv[_ZN7conext7details10SampleBaseI18PrimeNumberRequest17DDS_WriteParams_tE10initializeEv]+0x85) :
référence indéfinie vers « connext::heck_retcode(DDS_ReturnCode_t, char const*, RTILogMessage const&, std::string const&, bool) »

objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o :
Dans la fonction « connext::details::type_support_adapter<PrimeNumberRequest>:register_type(DDSTypeSupport*, DDSDomainParticipant*) » :
PrimeNumberRequester.cxx:(.text._ZN7connext7details20type_support_adapterI18PrimeNumberRequestE13register_typeEP14DDSTypeSupprtP20DDSDomainParticipant[_ZN7connext7details20type_support_adapterI18PrimeNumberRequestE13register_typeEP14DDSTypeSupportP20DSDomainParticipant]+0xa6) :
 => référence indéfinie vers « connext::check_retcode(DDS_ReturnCode_t, char const*, RTILogMessage cnst&, std::string const&, bool) »
objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o : Dans la fonction « connext::details::type_support_adapter<PrimeNumberReply>::egister_type(DDSTypeSupport*, DDSDomainParticipant*) » :
PrimeNumberRequester.cxx:(.text._ZN7connext7details20type_support_adapterI16PrimeNumberReplyE13register_typeEP14DDSTypeSupporP20DDSDomainParticipant[_ZN7connext7details20type_support_adapterI16PrimeNumberReplyE13register_typeEP14DDSTypeSupportP20DDSDmainParticipant]+0xa6) :
 => référence indéfinie vers « connext::check_retcode(DDS_ReturnCode_t, char const*, RTILogMessage const, std::string const&, bool) »
 
etc.
 
 
Thank you very much for your help,
 
Laurent Coyaud
RATP.
 

 

Organization:
Offline
Last seen: 3 years 8 months ago
Joined: 01/05/2021
Posts: 4
Hello,
here are more details :
1) gcc version 
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44)
 
2) linux distribution version
[lcoyaud@server]$ cat /etc/*release
CentOS Linux release 7.9.2009 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
CentOS Linux release 7.9.2009 (Core)
CentOS Linux release 7.9.2009 (Core)
 
3) Complete log
I will send the complete error log tomorrow, but the log is a long list of undefined refernce as shown on the sample given.
 
Thank you very much,
Best Regards
Laurent Coyaud
Offline
Last seen: 3 years 8 months ago
Joined: 01/05/2021
Posts: 4

Hello,

i made a mistake in the gcc version. the gcc version is 

gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5
 
 
The full error log is below:
 
 
hello_world_request_reply]$ make -f make/makefile_RequestReplyPrimes_x64Linux4gcc7.3.0
Checking directory objs
Checking directory objs/x64Linux4gcc7.3.0
g++ -m64 -Wl,--no-as-needed -o objs/x64Linux4gcc7.3.0/PrimeNumberRequester objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o ojs/x64Linux4gcc7.3.0/PrimesPlugin.o objs/x64Linux4gcc7.3.0/Primes.o objs/x64Linux4gcc7.3.0/PrimesSupport.o -L/opt/rti_connextdds-6.0.1/lib/x64Linux4gcc7.3.0 -lrticonnextmsgcppz -lnddscppz -lnddscz -lnddscorez -ldl -lm -lpthread -lrt
objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o : Dans la fonction « PrimeNumberRequesterExample::run_example(int, int) » :
PrimeNumberRequester.cxx:(.text._ZN27PrimeNumberRequesterExample11run_exampleEii[_ZN27PrimeNumberRequesterExample11run_examplEii]+0x7c) : référence indéfinie vers « connext::RequesterParams::service_name(std::string const&) »
PrimeNumberRequester.cxx:(.text._ZN27PrimeNumberRequesterExample11run_exampleEii[_ZN27PrimeNumberRequesterExample11run_examplEii]+0x10e) : référence indéfinie vers « connext::RequesterParams::qos_profile(std::string const&, std::string const&) »
objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o : Dans la fonction « connext::details::SampleBase<PrimeNumberRequest, DDS_Writearams_t>::initialize() » :
PrimeNumberRequester.cxx:(.text._ZN7connext7details10SampleBaseI18PrimeNumberRequest17DDS_WriteParams_tE10initializeEv[_ZN7conext7details10SampleBaseI18PrimeNumberRequest17DDS_WriteParams_tE10initializeEv]+0x85) : référence indéfinie vers « connext::heck_retcode(DDS_ReturnCode_t, char const*, RTILogMessage const&, std::string const&, bool) »
objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o : Dans la fonction « connext::details::type_support_adapter<PrimeNumberRequest>:register_type(DDSTypeSupport*, DDSDomainParticipant*) » :
PrimeNumberRequester.cxx:(.text._ZN7connext7details20type_support_adapterI18PrimeNumberRequestE13register_typeEP14DDSTypeSupprtP20DDSDomainParticipant[_ZN7connext7details20type_support_adapterI18PrimeNumberRequestE13register_typeEP14DDSTypeSupportP20DSDomainParticipant]+0xa6) : référence indéfinie vers « connext::check_retcode(DDS_ReturnCode_t, char const*, RTILogMessage cnst&, std::string const&, bool) »
objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o : Dans la fonction « connext::details::type_support_adapter<PrimeNumberReply>::egister_type(DDSTypeSupport*, DDSDomainParticipant*) » :
PrimeNumberRequester.cxx:(.text._ZN7connext7details20type_support_adapterI16PrimeNumberReplyE13register_typeEP14DDSTypeSupporP20DDSDomainParticipant[_ZN7connext7details20type_support_adapterI16PrimeNumberReplyE13register_typeEP14DDSTypeSupportP20DDSDmainParticipant]+0xa6) : référence indéfinie vers « connext::check_retcode(DDS_ReturnCode_t, char const*, RTILogMessage const, std::string const&, bool) »
objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o : Dans la fonction « connext::details::SampleBase<PrimeNumberRequest, DDS_Writearams_t>::copy_from(PrimeNumberRequest const&) » :
PrimeNumberRequester.cxx:(.text._ZN7connext7details10SampleBaseI18PrimeNumberRequest17DDS_WriteParams_tE9copy_fromERKS2_[_ZN7onnext7details10SampleBaseI18PrimeNumberRequest17DDS_WriteParams_tE9copy_fromERKS2_]+0x7d) : référence indéfinie vers « connet::check_retcode(DDS_ReturnCode_t, char const*, RTILogMessage const&, std::string const&, bool) »
objs/x64Linux4gcc7.3.0/PrimeNumberRequester.o : Dans la fonction « connext::LoanedSamples<PrimeNumberReply>::move_construct_fom_loans(PrimeNumberReplyDataReader*, PrimeNumberReplySeq&, DDS_SampleInfoSeq&) » :
PrimeNumberRequester.cxx:(.text._ZN7connext13LoanedSamplesI16PrimeNumberReplyE25move_construct_from_loansEP26PrimeNumberReplyataReaderR19PrimeNumberReplySeqR17DDS_SampleInfoSeq[_ZN7connext13LoanedSamplesI16PrimeNumberReplyE25move_construct_from_loansP26PrimeNumberReplyDataReaderR19PrimeNumberReplySeqR17DDS_SampleInfoSeq]+0x86) : référence indéfinie vers « connext::check_recode(DDS_ReturnCode_t, char const*, RTILogMessage const&, std::string const&, bool) »
collect2: error: ld returned 1 exit status
make: *** [make/makefile_RequestReplyPrimes_x64Linux4gcc7.3.0:90: objs/x64Linux4gcc7.3.0/PrimeNumberRequester] Error 1
Howard's picture
Offline
Last seen: 3 days 11 hours ago
Joined: 11/29/2012
Posts: 608

So, does your project have a commercial support contract with RTI?  It may be easier for the support team to trouble shoot this.

1) In looking over the output, I'm puzzled.  Did you copy and paste this output?  I see weird places where letters are missing:

connext::check_recode(DDS_ReturnCode_t, char const*, RTILogMessage const&, std::string const&, bool)

should be

connext::check_retcode(DDS_ReturnCode_t, char const*, RTILogMessage const&, std::string const&, bool)

or

connext::heck_retcode(

should be

connext::check_retcode

2) which version of the request/reply example are you compiling?  From

rti_workspace\6.0.1\examples\connext_dds\c++11\hello_world_request_reply

or

rti_workspace\6.0.1\examples\connext_dds\c++\hello_world_request_reply

3) in the same command windows where you run make, if you run

g++ -v

what is the output?

 

 

Offline
Last seen: 3 years 8 months ago
Joined: 01/05/2021
Posts: 4

Hello Howard, hello Alejandro,

We succeeded in compiling on linux the c++ hello_world_request_reply example (this one) : rti_workspace\6.0.1\examples\connext_dds\c++\hello_world_request_reply

The problem we had was that we used a g++ 7.3.1 compiler on a 7.3.0 Centos. Looking at the RTI  6.0.1 platform notes we saw that on Centos 7.x only the g++ 4.8.2 was supported. So we compiled with g++ 4.8.2 and the request_reply example did worked.

We should have looked at the core Librairies Platform Notes before !

Thank you for you help

Laurent Coyaud

 

 

Howard's picture
Offline
Last seen: 3 days 11 hours ago
Joined: 11/29/2012
Posts: 608

Great to hear that you got it to work.  Fundamentally, Connext DDS libs are built with a certain version of gcc against certain versions of libc/libc++.  It's not as much dependent on the underlying Linux version (though should be the same major Kernel version, 4.x, 3.x etc).

When we say that our libs were built on a specific version of an OS, e.g., Cent OS 7.x, we usually try to use whatever version of the toolchain "comes with" that OS version.  Unfortunately, if you install and try to use a newer toolchain, newer GCC...which usually also means newer libc/libc++, then that's when incompatiblities like the one you've encountered comes up.