pcl icon indicating copy to clipboard operation
pcl copied to clipboard

fatal error: pcl/visualization/pcl_visualizer.h

Open Mikeraka opened this issue 7 years ago • 6 comments

Your Environment

  • Operating System and version:Ubuntu16.04
  • Compiler:
  • PCL Version:1.9.1

I have installed the pcl successfully including the visualization module, but when I make a project, I ran into a problem as follows 2019-04-11 20-15-19屏幕截图 I find that in the cmake step, the pcl directories do not include the visualization dir as follows, what's the matter? I am very confused. Thank you very much 2019-04-11 20-14-46屏幕截图

Mikeraka avatar Apr 11 '19 12:04 Mikeraka

I don't think we will be able to provide much help until gcc starts printing error messages that are in English. :/

SergioRAgostinho avatar Apr 11 '19 14:04 SergioRAgostinho

@SergioRAgostinho Thank you very much for your answering the error is : fatal error: pcl/visualization/pcl_visualizer.h: NO such file or directory. but I have pcl_visualizer.h file in pcl directory.

Mikeraka avatar Apr 12 '19 01:04 Mikeraka

Then it's more likely a problem in the CMakeLists.txt of your project. Can you copy paste that file here and also the console output of the configuration stage? Small note, don't create images from text output. Just copy paste the actual text.

SergioRAgostinho avatar Apr 12 '19 07:04 SergioRAgostinho

@SergioRAgostinho I have sovled this problem, Thank you very much for your answering

SunshineDou avatar Apr 12 '19 07:04 SunshineDou

Hy there @SunshineDou I have a similar problem, can you please explain, how did you solve this? I'm trying to compile, PCL with libtorch. My CMakeLists.txt is

cmake_minimum_required(VERSION 2.6) include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) if(COMPILER_SUPPORTS_CXX11) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") elseif(COMPILER_SUPPORTS_CXX0X) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") endif()

find_package(PCL 1.7 REQUIRED) find_package(Torch REQUIRED) add_executable(main main.cpp)

include_directories(${PCL_INCLUDE_DIRS}) link_directories(${PCL_LIBRARY_DIRS}) add_definitions(${PCL_DEFINITIONS})

target_link_libraries(main ${PCL_LIBRARIES})

target_link_libraries(main ${TORCH_LIBRARIES}) target_include_directories(main PUBLIC ${PCL_INCLUDE_DIR})

message("STATUS PCL PATH${PCL_INCLUDE_DIRS}")

ERROR: In function main': main.cpp:(.text+0x1d44): undefined reference to pcl::visualization::PCLVisualizer::PCLVisualizer(std::string const&, bool)' main.cpp:(.text+0x1eaf): undefined reference to `pcl::visualization::PCLVisualizer::setPointCloudRenderingProperties(int, double, std::string const&, int)' collect2: error: ld returned 1 exit status

UsamaHasan avatar May 02 '19 10:05 UsamaHasan

@SergioRAgostinho I have sovled this problem, Thank you very much for your answering

Thanks,can you tell me how to the sovle the problem?

East-Face avatar Dec 25 '19 15:12 East-Face