PCL 出错:体系结构x86_64 @pcl的未定义符号
PCL make error: Undefined symbols for architecture x86_64 @pcl
使用 cmake 没有错误 ..
按如下方式制作时发生错误:
Scanning dependencies of target environment
[ 25%] Building CXX object CMakeFiles/environment.dir/src/environment.cpp.o
[ 50%] Building CXX object CMakeFiles/environment.dir/src/render/render.cpp.o
[ 75%] Building CXX object CMakeFiles/environment.dir/src/processPointClouds.cpp.o
[100%] Linking CXX executable environment
Undefined symbols for architecture x86_64:
"pcl::visualization::createLine(Eigen::Matrix<float, 4, 1, 0, 4, 1> const&, Eigen::Matrix<float, 4, 1, 0, 4, 1> const&)", referenced from:
bool pcl::visualization::PCLVisualizer::addLine<pcl::PointXYZ, pcl::PointXYZ>(pcl::PointXYZ const&, pcl::PointXYZ const&, double, double, double, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) in render.cpp.o
"pcl::visualization::PCLVisualizer::removeShape(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int)", referenced from:
clearRays(boost::shared_ptr<pcl::visualization::PCLVisualizer>&) in render.cpp.o
"pcl::visualization::PCLVisualizer::updateCells(vtkSmartPointer<vtkIdTypeArray>&, vtkSmartPointer<vtkIdTypeArray>&, long long)", referenced from:
...
...
...
...
_main in environment.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [environment] Error 1
make[1]: *** [CMakeFiles/environment.dir/all] Error 2
make: *** [all] Error 2
这些清单.txt
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
add_definitions(-std=c++11)
set(CXX_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS, "${CXX_FLAGS}")
project(playback)
find_package(PCL 1.2 REQUIRED COMPONENTS common io)
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")
add_executable (environment src/environment.cpp src/render/render.cpp src/processPointClouds.cpp)
target_link_libraries (environment ${PCL_LIBRARIES})
OSmac catarina PCL 1.9 xcode
问题应该与cmakelist有关.txt例如库链接,但我没有任何想法来定位和修复它。
通过链接库解决:
find_package(PCL 1.3 REQUIRED COMPONENT common io VISUALIZATION)
target_link_libraries (environment ${PCL_LIBRARIES} ${PCL_COMMON_LIBRARIES} ${PCL_IO_LIBRARIES} ${PCL_VISUALIZATION_LIBRARIES})
相关文章:
- 编译C++时未定义的引用
- vscode g++链路故障:体系结构x86_64的未定义符号
- 如何修复此错误:未定义对"距离(浮点数,浮点数,浮点数,浮点数,浮点数)"的引用
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 不知道某个东西是否被忽略会引入未定义的行为吗
- 对C宏的未定义引用,但在定义它时会出现重新定义错误
- 未定义的引用在哪里
- 编译时的 CImg 库返回对"__imp_SetDIBitsToDevice"的未定义引用
- 对Py_Initialize()的未定义引用
- c++11评估顺序(未定义的行为)
- 使用mysql c++连接器的未定义引用
- 从python调用openMP共享库时,未定义opnMP函数
- 在 Mac 上使用 CMAKE 将 FFTW 和 FFTWPP 链接到项目中时未定义的符号
- Cmake 链接问题:未定义对 Button::mousePressEvent(QGraphicsSceneMouseE
- 未定义的引用 .. 使用 OpenCV 编译 C++ 代码时,从命令行
- 具有外部"c"和程序集的未定义函数
- 此增量后语句是否会导致未定义的行为?
- 尝试调用 .h 文件中定义的变量时出现变量未定义错误
- PCL 出错:体系结构x86_64 @pcl的未定义符号
- PCL 和 CMake 的问题:链接时未定义统计异常值删除