How to link shared library on linux using cmake? - c++

How to link shared library on linux platform? I downloaded sfml library using apt cmd and I tried to run simple example:
main.cpp
#include <SFML/Graphics.hpp>
int main()
{
// Make a window that is 800 by 200 pixels
// And has the title "Hello from SFML"
sf::RenderWindow window(sf::VideoMode(800, 200), "Hello from SFML");
return 0;
}
But I keep getting undefined reference even though vs code sees files and lets me jump directly to them using ctrl button.
cmake:
cmake_minimum_required(VERSION 3.0.0)
project(sflmProject VERSION 0.1.0)
include(CTest)
enable_testing()
add_executable(sflmProject main.cpp)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
compilation error:
main] Building folder: firstSFLMProject
[build] Starting build
[main] Changes were detected in CMakeLists.txt but we could not reconfigure the project because another operation is already in progress.
[proc] Executing command: /usr/bin/cmake --build /home/black_wraith/Documents/AIR/S8/RealTime/firstSFLMProject/build --config Debug --target all -j 10 --
[build] -- Configuring done
[build] -- Generating done
[build] -- Build files have been written to: /home/black_wraith/Documents/AIR/S8/RealTime/firstSFLMProject/build
[build] Consolidate compiler generated dependencies of target sflmProject
[build] [ 50%] Building CXX object CMakeFiles/sflmProject.dir/main.cpp.o
[build] [100%] Linking CXX executable sflmProject
[build] /usr/bin/ld: CMakeFiles/sflmProject.dir/main.cpp.o: in function `main':
[build] /home/black_wraith/Documents/AIR/S8/RealTime/firstSFLMProject/main.cpp:16: undefined reference to `sf::String::String(char const*, std::locale const&)'
[build] /usr/bin/ld: /home/black_wraith/Documents/AIR/S8/RealTime/firstSFLMProject/main.cpp:16: undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
[build] /usr/bin/ld: /home/black_wraith/Documents/AIR/S8/RealTime/firstSFLMProject/main.cpp:16: undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
[build] /usr/bin/ld: /home/black_wraith/Documents/AIR/S8/RealTime/firstSFLMProject/main.cpp:63: undefined reference to `sf::RenderWindow::~RenderWindow()'
[build] collect2: error: ld returned 1 exit status
[build] gmake[2]: *** [CMakeFiles/sflmProject.dir/build.make:97: sflmProject] Error 1
[build] gmake[1]: *** [CMakeFiles/Makefile2:839: CMakeFiles/sflmProject.dir/all] Error 2
[build] gmake: *** [Makefile:121: all] Error 2
[build] Build finished with exit code 2
I tried to modify cmake like this but I just have no idea which file should I add:
cmake_minimum_required(VERSION 3.0.0)
project(sflmProject VERSION 0.1.0)
include(CTest)
enable_testing()
add_library(sfml SHARED /usr/include/SFML/*)
add_executable(sflmProject main.cpp)
target_link_libraries(sflmProject PRIVATE sfml)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)

here is an example of cmake file for sfml on linux
cmake_minimum_required(VERSION 3.22)
project(sfml-program LANGUAGES CXX)
add_executable(${PROJECT_NAME} main.cpp)
find_package (SFML 2.5 COMPONENTS graphics audio network REQUIRED)
target_link_libraries (${PROJECT_NAME} PUBLIC sfml-system sfml-graphics sfml-audio sfml-network)

Alternatively this works as well:
target_link_libraries(${PROJECT_NAME}
/usr/lib/x86_64-linux-gnu/libsfml-window.so
/usr/lib/x86_64-linux-gnu/libsfml-graphics.so
/usr/lib/x86_64-linux-gnu/libsfml-audio.so
/usr/lib/x86_64-linux-gnu/libsfml-network.so
/usr/lib/x86_64-linux-gnu/libsfml-system.so
)

Related

Can not link yaml-cpp with my cmake project

My CMakeLists.txt
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
project(test_includes)
#find_package(Boost COMPONENTS system filesystem REQUIRED)
#include_directories( ${Boost_INCLUDE_DIRS} )
set(Torch_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libtorch/share/cmake/Torch")
find_package(Boost COMPONENTS system filesystem REQUIRED)
find_package(Threads REQUIRED)
find_package(Torch REQUIRED)
find_package(yaml-cpp REQUIRED)
include_directories( ${Boost_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${yaml-cpp_INCLUDE_DIR}
${Torch_INCLUDE_DIRS}
include)
set(CMAKE_CXX_FLAGS_DEBUG "-g3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g3 -gdwarf -fno-omit-frame-pointer -DNDEBUG")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
add_subdirectory(include)
#link_directories(libraries)
set( LIBS_TO_LINK
Domains
Agents
Planning
yaml-cpp
${TORCH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT})# -llapack)
add_executable(testWarehouse testWarehouse.cpp)
target_link_libraries(testWarehouse ${LIBS_TO_LINK})
The error message i am getting:
...
[100%] Linking CXX executable testWarehouse
/usr/bin/ld: CMakeFiles/testWarehouse.dir/testWarehouse.cpp.o: in function `WarehouseSimulation(std::string const&, unsigned long)':
testWarehouse.cpp:(.text+0x13af): undefined reference to `YAML::LoadFile(std::string const&)'
/usr/bin/ld: CMakeFiles/testWarehouse.dir/testWarehouse.cpp.o: in function `YAML::detail::node_ref::set_scalar(std::string const&)':
testWarehouse.cpp:(.text._ZN4YAML6detail8node_ref10set_scalarERKSs[_ZN4YAML6detail8node_ref10set_scalarERKSs]+0x2a): undefined reference to `YAML::detail::node_data::set_scalar(std::string const&)'
/usr/bin/ld: CMakeFiles/testWarehouse.dir/testWarehouse.cpp.o: in function `YAML::Node::Scalar() const':
testWarehouse.cpp:(.text._ZNK4YAML4Node6ScalarEv[_ZNK4YAML4Node6ScalarEv]+0x79): undefined reference to `YAML::detail::node_data::empty_scalar()'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/testWarehouse.dir/build.make:109: testWarehouse] Error 1
make[1]: *** [CMakeFiles/Makefile2:152: CMakeFiles/testWarehouse.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
note: i do have yamp-cpp installed
my full project:
i have tried manually adding -lyaml-cpp to the compile commands, with no effect.
can someone please check my CMakeLists.txt and tell my if am linking yaml-cpp properly, Thanks. (i am 99% sure that it is correct)
i have tried yaml-cpp versions 7.0, 6.3, 5.3 all with the same result
looking at .../build/CMakeCache.txt it includes:
//The directory containing a CMake configuration file for yaml-cpp.
yaml-cpp_DIR:PATH=/usr/share/cmake/yaml-cpp
which looks correct to me
if you need any more info please ask
Thank you
it was pre C++11 ABI issue
the solution can be found at:
https://github.com/pytorch/pytorch/issues/19353#issuecomment-652314883

undefined reference to `testing::UnitTest::Run()

The different repository images
add_executable(test_labyrinthe test_labyrinthe.cpp)
add_test(test_labyrinthe.cpp test_labyrinthe)
target_link_libraries(test_labyrinthe ${GTEST_LIBRARIES})
This is what I have in Test/CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(TP1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES
Labyrinthe.cpp
Labyrinthe.h
Piece.cpp
Piece.h
Porte.cpp
Porte.h
Principal.cpp)
add_executable(TP1 ${SOURCE_FILES})
###########
## GTEST ##
###########
option(BUILD_TESTING "build unit tests" ON)
if(BUILD_TESTING)
include(ExternalProject)
ExternalProject_add(gtest-target
GIT_REPOSITORY "https://github.com/google/googletest"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/extern"
UPDATE_COMMAND ""
)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/extern/include)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/extern/lib)
set(GTEST_LIBRARIES pthread gtest gmock gtest_main gmock_main)
enable_testing()
add_subdirectory(test)
endif()
This is what I have in the main CMakeLists.txt. Keep in mind that I have the only line #include <gtest/gtest.h> in test_labyrinthe.cpp.
When I run cmake .. and make, I got
[ 53%] Built target gtest-target
[ 86%] Built target TP1
Scanning dependencies of target test_labyrinthe
[ 93%] Building CXX object test/CMakeFiles/test_labyrinthe.dir/test_labyrinthe.cpp.o
[100%] Linking CXX executable test_labyrinthe
/usr/bin/ld: /home/infinity/ULaval/Session_Hiver_2021/Algorithmes_et_Structures_de_donnees/Travaux_Pratiques/TP1/CodeTP1/extern/lib/libgtest_main.a(gtest_main.cc.o): in function `main':
gtest_main.cc:(.text+0x3a): undefined reference to `testing::InitGoogleTest(int*, char**)'
/usr/bin/ld: /home/infinity/ULaval/Session_Hiver_2021/Algorithmes_et_Structures_de_donnees/Travaux_Pratiques/TP1/CodeTP1/extern/lib/libgtest_main.a(gtest_main.cc.o): in function `RUN_ALL_TESTS()':
gtest_main.cc:(.text._Z13RUN_ALL_TESTSv[_Z13RUN_ALL_TESTSv]+0x9): undefined reference to `testing::UnitTest::GetInstance()'
/usr/bin/ld: gtest_main.cc:(.text._Z13RUN_ALL_TESTSv[_Z13RUN_ALL_TESTSv]+0x11): undefined reference to `testing::UnitTest::Run()'
collect2: error: ld returned 1 exit status
make[2]: *** [test/CMakeFiles/test_labyrinthe.dir/build.make:84: test/test_labyrinthe] Error 1
make[1]: *** [CMakeFiles/Makefile2:152: test/CMakeFiles/test_labyrinthe.dir/all] Error 2
make: *** [Makefile:95: all] Error 2
This is really weird. Not sure how to make this work. Can you help?
EDIT When I run make test, I got
└╼ make test
Running tests...
Test project /home/infinity/ULaval/Session_Hiver_2021/Algorithmes_et_Structures_de_donnees/Travaux_Pratiques/TP1/CodeTP1
Start 1: test_labyrinthe.cpp
Could not find executable test_labyrinthe
Looked in the following places:
test_labyrinthe
test_labyrinthe
Release/test_labyrinthe
Release/test_labyrinthe
Debug/test_labyrinthe
Debug/test_labyrinthe
MinSizeRel/test_labyrinthe
MinSizeRel/test_labyrinthe
RelWithDebInfo/test_labyrinthe
RelWithDebInfo/test_labyrinthe
Deployment/test_labyrinthe
Deployment/test_labyrinthe
Development/test_labyrinthe
Development/test_labyrinthe
Unable to find executable: test_labyrinthe
1/1 Test #1: test_labyrinthe.cpp ..............***Not Run 0.00 sec
0% tests passed, 1 tests failed out of 1
Total Test time (real) = 0.00 sec
The following tests FAILED:
1 - test_labyrinthe.cpp (Not Run)
Errors while running CTest
make: *** [Makefile:84: test] Error 8
I believe the underlying problem is:
Keep in mind that I have the only line #include <gtest/gtest.h> in test_labyrinthe.cpp.
You'll want to add an actual test case to the file.
test_labyrinthe.cpp:
#include <gtest/gtest.h>
TEST(SomeTest, ABasicTest) {
EXPECT_EQ(1, 1);
}
Once you do that you'll probably run into some pthread linker errors. Changing to link pthread after gtest should resolve that.
set(GTEST_LIBRARIES gtest gmock gtest_main gmock_main pthread)
After uncountable tries, the solution was to add -pthread as you see here:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")

CMake & CodeSynthesis Header-only library not compiling

I have been trying to implement the runtime library which is a header-only library of CodeSynthesis. But I only get a linking compiling error whenever I try to run the generated files which are made by the XSD executable.
Here is the error to show you that I have a linking problem with the runtime library:
[100%] Linking CXX executable XercesGebeuren.exe
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\XercesGebeuren.dir/objects.a(hello.cxx.obj): in function `xsd::cxx::xml::initialize()':
C:/Users/husey/Desktop/XercesGebeuren/xsd-4.0.0-i686-windows/libxsd/xsd/cxx/xml/elements.hxx:84: undefined reference to `xercesc_3_2::XMLPlatformUtils::Initialize(char const*, char const*, xercesc_3_2::PanicHandler*, xercesc_3_2::MemoryManager*)'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\XercesGebeuren.dir/objects.a(hello.cxx.obj): in function `xsd::cxx::xml::terminate()':
C:/Users/husey/Desktop/XercesGebeuren/xsd-4.0.0-i686-windows/libxsd/xsd/cxx/xml/elements.hxx:90: undefined reference to `xercesc_3_2::XMLPlatformUtils::Terminate()'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\XercesGebeuren.dir/objects.a(hello.cxx.obj): in function `xsd::cxx::xml::sax::std_input_stream::std_input_stream(std::istream&)':
C:/Users/husey/Desktop/XercesGebeuren/xsd-4.0.0-i686-windows/libxsd/xsd/cxx/xml/sax/std-input-source.hxx:27: undefined reference to `xercesc_3_2::BinInputStream::BinInputStream()'
---- [And so on] ----
collect2.exe: error: ld returned 1 exit status
mingw32-make[3]: *** [CMakeFiles\XercesGebeuren.dir\build.make:122: XercesGebeuren.exe] Error 1
mingw32-make[2]: *** [CMakeFiles\Makefile2:95: CMakeFiles/XercesGebeuren.dir/all] Error 2
mingw32-make[1]: *** [CMakeFiles\Makefile2:102: CMakeFiles/XercesGebeuren.dir/rule] Error 2
mingw32-make: *** [Makefile:137: XercesGebeuren] Error 2
I have followed the guide given by CodeSynthesis to generate my hello.cxx & hello.hxx files with the command: xsd cxx-tree --std c++11 hello.xsd
CMake
cmake_minimum_required(VERSION 3.17)
project(XercesGebeuren)
set(CMAKE_CXX_STANDARD 20)
set(Xsd_DIR ./cmake)
find_package(XercesC REQUIRED)
find_package(Xsd REQUIRED)
add_executable(XercesGebeuren main.cpp src/hello.cxx)
add_library(mylib INTERFACE)
target_include_directories(mylib PUBLIC INTERFACE "./libxsd/")
target_include_directories(XercesGebeuren PUBLIC ${XSD_INCLUDE_DIR})
target_link_libraries(XercesGebeuren PUBLIC mylib)
Thanks to 'Asteroids With Wings' I figured out that a header-only library should not be added as a library in CMake.
Including the library and linking the XercesC library was enough.
CMake solution
cmake_minimum_required(VERSION 3.17)
project(XercesGebeuren)
set(CMAKE_CXX_STANDARD 20)
set(Xsd_DIR ./cmake)
find_package(XercesC REQUIRED)
find_package(Xsd REQUIRED)
add_executable(XercesGebeuren main.cpp src/hello.cxx )
target_include_directories(XercesGebeuren PUBLIC ${XSD_INCLUDE_DIR})
target_link_libraries(XercesGebeuren PUBLIC XercesC::XercesC)

Link SDL and Glut in CMake

I have a project (on linux) where I require glut and SDL.
I already managed to properly link glut, but I still cant get SDL linked.
My CMake file looks like this:
cmake_minimum_required(VERSION 3.7)
project(ObjLoader)
add_executable(testas main.cpp)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
include_directories( ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} )
target_link_libraries(testas ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
When building the following exception is error occurs:
/opt/JetBrains/apps/CLion/ch-0/181.4668.70/bin/cmake/bin/cmake --build /home/void/Documents/Projects/ObjLoader/cmake-build-debug --target testas -- -j 2
[ 50%] Linking CXX executable testas
CMakeFiles/testas.dir/main.cpp.o: In function `main':
/home/user/Documents/Projects/ObjLoader/main.cpp:165: undefined reference to `SDL_Init'
/home/user/Documents/Projects/ObjLoader/main.cpp:166: undefined reference to `SDL_SetVideoMode'
/home/user/Documents/Projects/ObjLoader/main.cpp:173: undefined reference to `SDL_GetTicks'
/home/user/Documents/Projects/ObjLoader/main.cpp:174: undefined reference to `SDL_PollEvent'
/home/user/Documents/Projects/ObjLoader/main.cpp:184: undefined reference to `SDL_GL_SwapBuffers'
/home/user/Documents/Projects/ObjLoader/main.cpp:188: undefined reference to `SDL_GetTicks'
/home/user/Documents/Projects/ObjLoader/main.cpp:189: undefined reference to `SDL_GetTicks'
/home/user/Documents/Projects/ObjLoader/main.cpp:189: undefined reference to `SDL_Delay'
/home/user/Documents/Projects/ObjLoader/main.cpp:191: undefined reference to `SDL_Quit'
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/testas.dir/build.make:100: testas] Error 1
make[2]: *** [CMakeFiles/Makefile2:68: CMakeFiles/testas.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:80: CMakeFiles/testas.dir/rule] Error 2
make: *** [Makefile:118: testas] Error 2
but the same problem persists,
When I try to link it as described here: How to use SDL2 and SDL_image with cmake
the same problem persists. How can I properly include and link SDL in the CMake file above?
My attempt was this:
cmake_minimum_required(VERSION 3.7)
project(ObjLoader)
add_executable(testas main.cpp)
find_package(OpenGL REQUIRED)
find_package(GLUT REQUIRED)
find_package(SDL2 REQUIRED)
include_directories( ${OPENGL_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS} ${SDL2_INCLUDE_DIRS})
target_link_libraries(testas ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} ${SDL2_LIBRARIES})
Doesnt change anything, same problem.

linking to a custom library using cmake

I have two cmake files that build a directory and then try to compile an example that uses that library. The content of the first CMakeLists.txt file stored at the project root ${CMAKE_SOURCE_DIR} is:
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project("lsd_point_pair")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
#Note: Eclipse automatically picks up include paths with this on!
SET(CMAKE_VERBOSE_MAKEFILE ON)
SET(CMAKE_CXX_FLAGS "-g")
find_package(PCL 1.7 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
set(BOOST_LIBS program_options)
find_package(Boost COMPONENTS ${BOOST_LIBS} REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})
MESSAGE(" Boost_LIBRARIES: ${Boost_LIBRARIES}")
include_directories(${PROJECT_BINARY_DIR})
link_directories(${PROJECT_BINARY_DIR}/lib})
add_library(lsd_obj_rec_ransac lsd_obj_rec_ransac.cpp lsd_obj_rec_ransac.h lsd_point_pair_model_library.cpp lsd_point_pair_model_library.h ndim_voxel_structure.h orr_octree_cloud.h orr_octree_cloud.cpp)
target_link_libraries(lsd_obj_rec_ransac ${PCL_LIBRARIES} ${Boost_LIBRARIES})
######## subdirectories #########
add_subdirectory(examples)
In ${CMAKE_SOURCE_DIR}/examples I have the following CMakeLists.txt file:
add_executable(example_pcl_lsd_point_pair example_pcl_lsd_point_pair.cpp)
target_link_libraries(example_pcl_lsd_point_pair lsd_obj_rec_ransac ${Boost_LIBRARIES} ${PCL_LIBRARIES})
After successfully running cmake I run make and I get the linking errors:
CMakeFiles/example_pcl_lsd_point_pair.dir/example_pcl_lsd_point_pair.cpp.o: In function `~LSDObjRecRANSAC':
make[2]: Leaving directory `/media/Data/Documents/Grad/research/Projects/LSDPointPairs/qtcreator-build'
make[1]: Leaving directory `/media/Data/Documents/Grad/research/Projects/LSDPointPairs/qtcreator-build'
/home/mustafa/projects/LSDPointPairs/examples/../lsd_obj_rec_ransac.h:44: undefined reference to `pcl::recognition::ORROctreeCloud::~ORROctreeCloud()'
/home/mustafa/projects/LSDPointPairs/examples/../lsd_obj_rec_ransac.h:44: undefined reference to `pcl::recognition::ORROctreeCloud::~ORROctreeCloud()'
../lib/liblsd_obj_rec_ransac.a(lsd_obj_rec_ransac.cpp.o): In function `LSDObjRecRANSAC':
/home/mustafa/projects/LSDPointPairs/lsd_obj_rec_ransac.cpp:18: undefined reference to `pcl::recognition::LSDPointPairModelLibrary::LSDPointPairModelLibrary(float, float, float)'
/home/mustafa/projects/LSDPointPairs/lsd_obj_rec_ransac.cpp:18: undefined reference to `pcl::recognition::ORROctreeCloud::ORROctreeCloud()'
/home/mustafa/projects/LSDPointPairs/lsd_obj_rec_ransac.cpp:18: undefined reference to `pcl::recognition::ORROctreeCloud::~ORROctreeCloud()'
../lib/liblsd_obj_rec_ransac.a(lsd_point_pair_model_library.cpp.o): In function `LSDPointPairModel':
/home/mustafa/projects/LSDPointPairs/lsd_point_pair_model_library.h:36: undefined reference to `pcl::recognition::ORROctreeCloud::ORROctreeCloud()'
/home/mustafa/projects/LSDPointPairs/lsd_point_pair_model_library.h:36: undefined reference to `pcl::recognition::ORROctreeCloud::~ORROctreeCloud()'
../lib/liblsd_obj_rec_ransac.a(lsd_point_pair_model_library.cpp.o): In function `~LSDPointPairModel':
/home/mustafa/projects/LSDPointPairs/lsd_point_pair_model_library.h:27: undefined reference to `pcl::recognition::ORROctreeCloud::~ORROctreeCloud()'
/home/mustafa/projects/LSDPointPairs/lsd_point_pair_model_library.h:27: undefined reference to `pcl::recognition::ORROctreeCloud::~ORROctreeCloud()'
collect2: ld returned 1 exit status
make[2]: *** [bin/example_pcl_lsd_point_pair] Error 1
make[1]: *** [examples/CMakeFiles/example_pcl_lsd_point_pair.dir/all] Error 2
make: *** [all] Error 2
The library successfully gets built because I see the liblsd_obj_rec_ransac.a file gets generated. But the problem happens when trying to compile the example. What am I doing wrong?