Hello,
having problems setting up a console program using the external library pdal (www.pdal.io)
What I did:
New Project, Hello-World main, which runs.
Adding pdal-includes like:
|
#include <pdal/Reader.hpp>
|
In CodeBlocks:
Added the header and source code files recursively from the pdal dir.
pdal/pdal
pdal/io
pdal/filters
pdal/kernal
pdal/plugins
pdal/vendor
Results building it:
1 2
|
/home/patrick/unifr/pdal/pdal/Stage.hpp|39|fatal error: pdal/Dimension.hpp: No
such file or directory|
|
When I try it with cmake (according to the toturial on pdal.io/dev/cmake)
Added a CMakeLists.txt in the project root folder with:
1 2 3 4 5 6 7 8 9 10 11 12
|
cmake_minimum_required(VERSION 3.5)
project(PDAL VERSION 2.0.0 LANGUAGES CXX C)
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
include_directories(${PDAL_INCLUDE_DIRS})
link_directories(${PDAL_LIBRARY_DIRS})
add_definitions(${PDAL_DEFINITIONS})
set(CMAKE_CXX_FLAGS "-std=c++11")
add_executable(pdal_console main.cpp)
target_link_libraries(pdal_console PRIVATE ${PDAL_LIBRARIES})
|
(Added the line "include_directories(${/home/patrick/unifr/pdal/})")
which results in: (cmake ok), make:
1 2
|
/home/patrick/unifr/PDALConsole/main.cpp:3:10: fatal error: pdal/Reader.hpp: No such file or directory
#include "pdal/Reader.hpp"
|
I cloned the pdal source code from git.
My directories look as the following:
code root:
/home/patrick/unifr/
/home/patrick/unifr/PDALConsole/ <- my project with a main.cpp
/home/patrick/unifr/pdal/ <-pdal library header/source code
So what I am doing wrong? Problems seems to be connected in telling the compiler where the find the pdal files. I thought the line include_directories($PDAL..) should do the job, I even tried to add the absolute dir path (which didn't help either and should be done, no absolute paths).
I am not used to develop c++ with external source code. Did I do it correct with the pdal-source code .. is that how it is supposed to be done?
(I am in the field of developing quite a lot but not in C++)
My goal is to have an application which used the pdal library for reading and processing point clouds.
Used: ubuntu, CodeBlocks/cmake
Greetings,
Rick