Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problems linking pcl::io in ROS indigo

Hello all;

I have been working for a while with ROS Indigo and its included version of PCL. I am on a Ubuntu 14.04 x64 desktop. Previous nodes all work ok, but in the one I am programming now, I need to include pcl::io. the code reduced to minimal is:

#include "ros/ros.h"
#include <ros/package.h>
#include <sensor_msgs/PointCloud2.h>

//PCL
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl_conversions/pcl_conversions.h>

int main(int argc, char **argv)
{

  ros::init(argc, argv, "halcon3D_test_node");
  ros::NodeHandle n;

  //test PointCloud_to_ObjectModel3D
  ros::Publisher pub = n.advertise<sensor_msgs::PointCloud2>("point_cloud", 1000);

  std::string path = ros::package::getPath("tekniker_halcon_drivers") + "/resources/";
    std::string fileName = path + "CSite1_orig-utm.pcd";

    pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
    //pcl::io::loadPCDFile<pcl::PointXYZ> ("/home/alberto/catkin_euroc_ch1/src/tekniker_euroc_c1/resources/STL/object.pcd", *cloud);

  ros::Rate loop_rate(10);
  while (ros::ok())
  {
        sensor_msgs::PointCloud2 cloud2;
        pcl::toROSMsg(*cloud, cloud2);
        cloud2.header.frame_id = "point_cloud_link";
        cloud2.header.stamp = ros::Time::now();
        pub.publish(cloud2);
    ros::spinOnce();
    loop_rate.sleep();
  }
  return 0;
}

However, if I uncomment ths line:

pcl::io::loadPCDFile<pcl::PointXYZ> ("/home/alberto/catkin_euroc_ch1/src/tekniker_euroc_c1/resources/STL/object.pcd", *cloud);

I obtain the following linking errors:

//usr/lib/libpq.so.5: undefined reference to `SSL_get_peer_certificate@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `CRYPTO_num_locks@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_CTX_use_certificate_chain_file@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_use_certificate_file@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `ENGINE_free@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `OPENSSL_config@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_get_error@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_use_PrivateKey_file@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `X509_STORE_load_locations@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_set_ex_data@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_read@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `X509_STORE_set_flags@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSLv23_method@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `ENGINE_load_private_key@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `X509_get_subject_name@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `CRYPTO_set_id_callback@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_CTX_new@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_CTX_get_cert_store@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_check_private_key@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `ENGINE_by_id@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `ERR_get_error@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `CRYPTO_set_locking_callback@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_load_error_strings@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_new@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `X509_NAME_get_text_by_NID@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_write@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `X509_free@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_CTX_load_verify_locations@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_free@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_ctrl@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_set_verify@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `ENGINE_init@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_set_fd@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_connect@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `ERR_reason_error_string@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_CTX_ctrl@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_pending@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_use_PrivateKey@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `ENGINE_finish@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_library_init@OPENSSL_1.0.0'
//usr/lib/libpq.so.5: undefined reference to `SSL_shutdown@OPENSSL_1.0.0'
collect2: error: ld returned 1 exit status
make[2]: *** [/home/alberto/indigo_catkin_ws/devel/lib/tekniker_halcon_drivers/halcon3D_test_node] Error 1
make[1]: *** [tekniker_halcon_drivers/CMakeFiles/halcon3D_test_node.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j8 -l8" failed

Is there any known error related to this issue? Or any tweak to solve it? Thank you all in advance,

Alberto