tum-vision / lsd_slam

LSD-SLAM
GNU General Public License v3.0
2.58k stars 1.23k forks source link

error in rosmaking lsd_slam_viewer #347

Open aayushi363 opened 3 years ago

aayushi363 commented 3 years ago

while making lsd_slam the following error occur

CMakeFiles/videoStitch.dir/src/main_stitchVideos.cpp.o: In function dilate(int, char**)': main_stitchVideos.cpp:(.text+0x151): undefined reference tocv::imread(cv::String const&, int)' main_stitchVideos.cpp:(.text+0x159): undefined reference to cv::String::deallocate()' main_stitchVideos.cpp:(.text+0x181): undefined reference tocv::imread(cv::String const&, int)' main_stitchVideos.cpp:(.text+0x189): undefined reference to cv::String::deallocate()' main_stitchVideos.cpp:(.text+0x302): undefined reference tocv::imwrite(cv::String const&, cv::_InputArray const&, std::vector<int, std::allocator > const&)' main_stitchVideos.cpp:(.text+0x30a): undefined reference to cv::String::deallocate()' main_stitchVideos.cpp:(.text+0x39e): undefined reference tocv::fastFree(void)' main_stitchVideos.cpp:(.text+0x426): undefined reference to `cv::fastFree(void)' main_stitchVideos.cpp:(.text+0x627): undefined reference to cv::Mat::deallocate()' main_stitchVideos.cpp:(.text+0x636): undefined reference tocv::Mat::deallocate()' main_stitchVideos.cpp:(.text+0x66a): undefined reference to cv::String::deallocate()' main_stitchVideos.cpp:(.text+0x67c): undefined reference tocv::String::deallocate()' main_stitchVideos.cpp:(.text+0x692): undefined reference to `cv::String::deallocate()'

My cmakelist.txt is file is given below

cmake_minimum_required(VERSION 3.0.2) project(lsd_slam_viewer) include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake) include_directories(${OpenCV_INCLUDE_DIR}) find_package( OpenCV COMPONENTS core imgproc highgui imgcodecs REQUIRED ) LINK_DIRECTORIES("/usr/local/lib")

set(ROS_BUILD_TYPE Release)

rosbuild_init()

ADD_SUBDIRECTORY(${PROJECT_SOURCE_DIR}/thirdparty/Sophus)

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)

find_package(OpenGL REQUIRED) set(QT_USE_QTOPENGL TRUE) set(QT_USE_QTXML TRUE) find_package(QGLViewer REQUIRED) find_package(Eigen3 REQUIRED) include_directories(${QT_INCLUDES} ${EIGEN3_INCLUDE_DIR} ${QGLVIEWER_INCLUDE_DIR}) rosbuild_find_ros_package(dynamic_reconfigure) include(${dynamic_reconfigure_PACKAGE_PATH}/cmake/cfgbuild.cmake) gencfg() find_library(-lopencv_core RREQUIRED) find_library(-lopencv_imgproc RREQUIRED) find_library(-lopencv_highgui RREQUIRED) find_library(-lopencv_imgcodecs RREQUIRED)

rosbuild_genmsg()

rosbuild_check_for_sse() set(CMAKE_CXX_FLAGS "${SSE_FLAGS}" )

set(SOURCE_FILES
src/PointCloudViewer.cpp src/KeyFrameDisplay.cpp src/KeyFrameGraphDisplay.cpp src/settings.cpp )

set(HEADER_FILES
src/PointCloudViewer.h src/KeyFrameDisplay.h src/KeyFrameGraphDisplay.h src/settings.h )

include_directories( ${PROJECT_SOURCE_DIR}/thirdparty/Sophus )

rosbuild_add_executable(viewer src/main_viewer.cpp ${SOURCE_FILES} ${HEADER_FILES})

target_link_libraries(viewer ${QGLViewer_LIBRARIES} ${QT_LIBRARIES} ${QGLVIEWER_LIBRARY} GL glut GLU)

rosbuild_link_boost(viewer thread)

rosbuild_add_executable(videoStitch src/main_stitchVideos.cpp)