Using Robwork when installed from ppa does not work
When using finding robwork in cmake after installing from ppa (apt install libsdurw-all-dev) I get the following error:
Contents of CMakeLists.txt:
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(rw_test)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
find_package(RobWork REQUIRED)
include_directories(${ROBWORK_INCLUDE_DIRS})
add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} ${ROBWORK_LIBRARIES})
Contents of main.cpp:
#include <rw/core/Ptr.hpp>
#include <vector>
#include <iostream>
int main() {
auto ptr = rw::core::ownedPtr(new std::vector<int>{1, 2, 3});
std::cout << (*ptr)[1] << std::endl;
return 0;
}
This can be reproduced by running a fresh docker container of ubuntu 18.04 and installing robwork via ppa. The error does not happen if RobWork is compiled from source.