eProsima / Micro-XRCE-DDS

An XRCE DDS implementation. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
158 stars 15 forks source link

Unable to build micro-RTPS #2

Closed rohin28 closed 6 years ago

rohin28 commented 6 years ago

I'm unable to build micro-RTPS on my machine. I have already installed Fast-RTPS and Fast-CDR. While running the make command I get the following errors:

libagent.so: undefined reference toeprosima::fastrtps::xmlparser::XMLProfileManager::getDefaultSubscriberAttributes(eprosima::fastrtps::SubscriberAttributes&)' libagent.so: undefined reference to eprosima::fastrtps::xmlparser::XMLProfileManager::getDefaultPublisherAttributes(eprosima::fastrtps::PublisherAttributes&)' libagent.so: undefined reference toeprosima::fastrtps::xmlparser::XMLParser::loadXML(char const*, unsigned long, std::unique_ptr<eprosima::fastrtps::xmlparser::BaseNode, std::default_delete >&)' libagent.so: undefined reference to eprosima::fastrtps::xmlparser::XMLProfileManager::fillSubscriberAttributes(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, eprosima::fastrtps::SubscriberAttributes&)' libagent.so: undefined reference toeprosima::fastrtps::xmlparser::XMLProfileManager::fillPublisherAttributes(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, eprosima::fastrtps::PublisherAttributes&)' collect2: error: ld returned 1 exit status micro-RTPS-agent/CMakeFiles/micrortps_agent.dir/build.make:99: recipe for target 'micro-RTPS-agent/micrortps_agent' failed `

julionce commented 6 years ago

Hi @rohin28 I wasn't able to reproduce your error, please could you tell me your environment and the Micro and Fast RTPS versions (branches) you are using?

rohin28 commented 6 years ago

I'm on Ubuntu 16.04.3 LTS Xenial. I also have ROS2 installed on my system.

I built Fast-RTPS from source using these instructions. The build was successful. This is the master branch.

I was building Micro-RTPS also from source using these instructions. My cmake .. output is:

rohin@Dreamworks:~/learn_code/eprosima/micro-RTPS/build$ cmake .. -- Configuring done -- Generating done -- Build files have been written to: /home/rohin/learn_code/eprosima/micro-RTPS/build/micro-RTPS-agent/external/micrortps_transport [100%] Built target micrortps_transport -- micrortps_transport library not found... -- Configuring done -- Generating done -- Build files have been written to: /home/rohin/learn_code/eprosima/micro-RTPS/build/micro-RTPS-client/external/micrortps_transport [100%] Built target micrortps_transport -- micrortps_transport library not found... -- Configuring done -- Generating done -- Build files have been written to: /home/rohin/learn_code/eprosima/micro-RTPS/build/micro-RTPS-client/external/micro-CDR [100%] Built target micro-CDR -- micro-CDR library not found... -- Configuring micro CDR -- Version: 1.0.6 -- To change the version modify the file configure.ac -- Machine: little endian -- Configuring done -- Generating done -- Build files have been written to: /home/rohin/learn_code/eprosima/micro-RTPS/build

I managed to build Fast-RTPS and Micro-RTPS from source on an Ubuntu Docker container.

julionce commented 6 years ago

Hi rohin28. I was trying to reproduce this problem and I found a possible answer. If you have installed ROS2 on the same machine, it comes with a distribution of Fast-RTPS, so it is possible that you are linking with this distribution which doesn't contain the aforementioned functions. Please, try to update your ROS2 distribution or link with an updated Fast-RTPS, tell me if you succeed.