UZ-SLAMLab / ORB_SLAM3

ORB-SLAM3: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM
GNU General Public License v3.0
6.64k stars 2.57k forks source link

Linking error in building #904

Closed SPGC closed 5 months ago

SPGC commented 5 months ago
[ 47%] Linking CXX shared library ../lib/libORB_SLAM3.so
/usr/bin/ld: cannot find -lepoxy::epoxy: No such file or directory
/usr/bin/ld: cannot find -lOpenGL::EGL: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/ORB_SLAM3.dir/build.make:600: ../lib/libORB_SLAM3.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:148: CMakeFiles/ORB_SLAM3.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

All dependencies listed in ReadMe are installed. Target C++ version changed to 14, otherwise there were errors connected to Pangoline

SPGC commented 5 months ago

Solution found. To solve this problem it's need to download file from Pangolin repository and put it in ORB_SLAM3/cmake_modules dir, after that in CMakeList.txt add:

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/)

...

find_package(OpenGL)
find_package(epoxy REQUIRED)

include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/include/CameraModels
${PROJECT_SOURCE_DIR}/Thirdparty/Sophus
${EIGEN3_INCLUDE_DIR}
${Pangolin_INCLUDE_DIRS}
${epoxy_INCLUDE_DIRS}
)

...

target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so
-lboost_serialization
-lcrypto
${epoxy_LIBRARIES}
)
ouguangjun commented 5 months ago

thanks, it works

xwy-bit commented 5 months ago

Solution found. To solve this problem it's need to download file from Pangolin repository and put it in project dir, after that in CMakeList.txt add:

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/)

...

find_package(OpenGL)
find_package(epoxy REQUIRED)

include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/include/CameraModels
${PROJECT_SOURCE_DIR}/Thirdparty/Sophus
${EIGEN3_INCLUDE_DIR}
${Pangolin_INCLUDE_DIRS}
${epoxy_INCLUDE_DIRS}
)

...

target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so
-lboost_serialization
-lcrypto
${epoxy_LIBRARIES}
)

Well done, it works. By the way, the file should be added to the ORB_SLAM3/cmake_modules dir.

SPGC commented 5 months ago

Solution found. To solve this problem it's need to download file from Pangolin repository and put it in project dir, after that in CMakeList.txt add:

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/)

...

find_package(OpenGL)
find_package(epoxy REQUIRED)

include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/include/CameraModels
${PROJECT_SOURCE_DIR}/Thirdparty/Sophus
${EIGEN3_INCLUDE_DIR}
${Pangolin_INCLUDE_DIRS}
${epoxy_INCLUDE_DIRS}
)

...

target_link_libraries(${PROJECT_NAME}
${OpenCV_LIBS}
${EIGEN3_LIBS}
${Pangolin_LIBRARIES}
${PROJECT_SOURCE_DIR}/Thirdparty/DBoW2/lib/libDBoW2.so
${PROJECT_SOURCE_DIR}/Thirdparty/g2o/lib/libg2o.so
-lboost_serialization
-lcrypto
${epoxy_LIBRARIES}
)

Well done, it works. By the way, the file should be added to the ORB_SLAM3/cmake_modules dir.

Yes, sure, forgot to mention. Fixed this, thank you!