在我的项目“ open_data_driver”中执行make
时遇到以下错误。命令cmake .
成功完成:
CMakeFiles / open_data_driver.dir / src / Geoportale.cpp.o:在函数中 'Geoportale :: Geoportale()':Geoportale.cpp :(。text + 0x2a):未定义 参考“ VSIInstallCurlStreamingFileHandler”
Geoportale.cpp
的代码如下:
/*
* Geoportale.cpp
*
* Created on: Feb 14, 2014
* Author: enrico
*/
#include <climits>
#include </home/mikkita/odomi-master/open_data_driver/include/opendata/Geoportale.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include "/home/mikkita/odomi-master/open_data_driver/include/read/read.h"
#include "/home/mikkita/usr_include_gdal/gdal/cpl_port.h"
#include "/usr/include/gdal/cpl_vsi_virtual.h"
#include "/usr/include/gdal/cpl_string.h"
#include "/usr/include/gdal/cpl_multiproc.h"
#include "/usr/include/gdal/cpl_hash_set.h"
#include "/usr/include/gdal/cpl_time.h"
#include </usr/include/curl/curl.h>
#include <unistd.h>
#include <sys/stat.h>
#include "/home/mikkita/catkin_ws/include/geometry_msgs/Polygon.h"
#include "/home/mikkita/catkin_ws/devel/include/open_data_msg/Data.h"
#include "/home/mikkita/catkin_ws/devel/include/open_data_msg/Open_data.h"
#include "/home/mikkita/odomi-master/open_data_driver/include/opendata/ogr_geos.h"
Geoportale::Geoportale() {
VSIInstallCurlStreamingFileHandler();
}
Geoportale::~Geoportale() {}
/*Other code*/
CMakeLists.txt
的代码如下:
cmake_minimum_required(VERSION 2.8.3)
project(open_data_driver)
find_library(CURL_LIBRARY curl /usr/bin/curl.so)
find_library(GDAL_LIBRARY gdal /usr/lib/libgdal.so) ####MikkiTA
find_library(ZZIP_LIBRARY zzip /usr/lib/libzzip.so)
find_library(MYSQLCLIENT_LIBRARY mysqlclient /usr/lib/i386-linux-gnu/libmysqlclient.so)
find_library(MYSQLZ_LIBRARY z /usr/lib/i386-linux-gnu/libz.so)
find_library(curl_LIBRARIES curl /usr/bin/curl.so) ##MikkiTA
find_library(gdal_LIBRARIES gdal /usr/lib/libgdal.so) ####MikkiTA
find_library(zzip_LIBRARIES zzip /usr/lib/libzzip.so) ##MikkiTA
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
#open_data_msg
geometry_msgs
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES open_data_driver
CATKIN_DEPENDS roscpp rospy std_msgs
DEPENDS curl gdal zzip
)
include_directories(include
${catkin_INCLUDE_DIRS}
${curl_INCLUDE_DIRS}
${gdal_INCLUDE_DIRS}
${zzip_INCLUDE_DIRS}
${mysql_INCLUDE_DIRS}
${z_INCLUDE_DIRS}
)
link_directories(/usr/local/lib)
add_library(geoportale
src/Geoportale.cpp
src/read.cpp
src/Json/json_reader.cpp
src/Json/json_value.cpp
src/Json/json_writer.cpp
) ##MikkiTA delete src/Oggetto.cpp
target_link_libraries(geoportale
${CURL_LIBRARY}
${GDAL_LIBRARY}
)
add_executable(open_data_driver
src/open_data_driver.cpp
src/read.cpp
src/Json/json_reader.cpp
src/Json/json_value.cpp
src/Json/json_writer.cpp
src/Geoportale.cpp
src/Trasporti.cpp
src/Csv/csv_parser.cpp
src/PotenzaSegnale.cpp
src/Traffico.cpp
src/Weather.cpp
src/xml/pugixml.cpp
)
add_dependencies(open_data_driver
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(open_data_driver
${catkin_LIBRARIES}
#${CURL_LIBRARY} ${ZZIP_LIBRARY} ${ZZIP_LIBRARY}
)
target_link_libraries(open_data_driver
curl
gdal
zzip
mysqlclient
z
)
target_link_libraries(open_data_driver
${GDAL_LIBRARY}
) ##MikkiTA
target_link_libraries(open_data_driver
geoportale
) ##MikkiTA
add_executable(bounding_box_client
src/client.cpp
)
target_link_libraries(bounding_box_client
${catkin_LIBRARIES}
)
add_executable(open_data_sync
src/open_data_sync.cpp
src/Trasporti.cpp
src/Csv/csv_parser.cpp
src/read.cpp
)
add_dependencies(open_data_driver
${catkin_EXPORTED_TARGETS}
)
target_link_libraries(open_data_sync
${catkin_LIBRARIES}
)
target_link_libraries(open_data_sync
curl
zzip
mysqlclient
z
)
有人知道如何解决这个问题吗? 已安装GDAL 2.1.3。