在 Visual Studio 2019 年构建简单的点云可视化代码时,来自 PCL 的第三方库出现多个错误
Multiple errors from 3rd party libraries from PCL when building simple point cloud visualization code in Visual Studio 2019
我是 PCL(点云库)的新手,我试图构建一个简单的点云可视化代码,我在 Visual Studio 2019 年在他们的网站上找到了。当我尝试构建它,它给我在 PCL 文件夹中找到的头文件的错误。
我下载了 PCL 1.6,其中包含第 3 方头文件。我检查了我是否正确地包含了构建代码所需的必要目录,没有遗漏任何内容。我不确定如何处理这些错误,因为它们是由 PCL 库中包含的头文件引起的。任何帮助将不胜感激。
P.S。对于长代码和错误消息,我深表歉意。这是我第一次post在这里遇到问题。
下面是我在PCl网站上找到的简单点云可视化代码:
#include <pcl/visualization/cloud_viewer.h>
#include <iostream>
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>
int user_data;
void
viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor(1.0, 0.5, 1.0);
pcl::PointXYZ o;
o.x = 1.0;
o.y = 0;
o.z = 0;
viewer.addSphere(o, 0.25, "sphere", 0);
std::cout << "i only run once" << std::endl;
}
void
viewerPsycho(pcl::visualization::PCLVisualizer& viewer)
{
static unsigned count = 0;
std::stringstream ss;
ss << "Once per viewer loop: " << count++;
viewer.removeShape("text", 0);
viewer.addText(ss.str(), 200, 300, "text", 0);
//FIXME: possible race condition here:
user_data++;
}
int
main()
{
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::io::loadPCDFile("my_point_cloud.pcd", *cloud);
pcl::visualization::CloudViewer viewer("Cloud Viewer");
//blocks until the cloud is actually rendered
viewer.showCloud(cloud);
//use the following functions to get access to the underlying more advanced/powerful
//PCLVisualizer
//This will only get called once
viewer.runOnVisualizationThreadOnce(viewerOneOff);
//This will get called once per visualization iteration
viewer.runOnVisualizationThread(viewerPsycho);
while (!viewer.wasStopped())
{
//you can also do cool processing here
//FIXME: Note that this is running in a separate thread from viewerPsycho
//and you should guard against race conditions yourself...
user_data++;
}
return 0;
}
这是导致错误的 PCL 文件夹中的头文件:
#ifndef EIGEN_VECTORBLOCK_H
#define EIGEN_VECTORBLOCK_H
namespace Eigen {
namespace internal {
template<typename VectorType, int Size>
struct traits<VectorBlock<VectorType, Size> >
: public traits<Block<VectorType,
traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
traits<VectorType>::Flags & RowMajorBit ? Size : 1> >
{
};
}
template<typename VectorType, int Size> class VectorBlock
: public Block<VectorType,
internal::traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
internal::traits<VectorType>::Flags & RowMajorBit ? Size : 1>
{
typedef Block<VectorType,
internal::traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
internal::traits<VectorType>::Flags & RowMajorBit ? Size : 1> Base;
enum {
IsColVector = !(internal::traits<VectorType>::Flags & RowMajorBit)
};
public:
EIGEN_DENSE_PUBLIC_INTERFACE(VectorBlock)
using Base::operator=;
EIGEN_DEVICE_FUNC
inline VectorBlock(VectorType& vector, Index start, Index size)
: Base(vector,
IsColVector ? start : 0, IsColVector ? 0 : start,
IsColVector ? size : 1, IsColVector ? 1 : size)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock);
}
EIGEN_DEVICE_FUNC
inline VectorBlock(VectorType& vector, Index start)
: Base(vector, IsColVector ? start : 0, IsColVector ? 0 : start)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock);
}
};
} // end namespace Eigen
#endif // EIGEN_VECTORBLOCK_H
下面是我在构建代码时不断收到的错误消息(我没有包含几行错误,因为我的 post 超出了字符数):
1>------ Build started: Project: PCL_trial, Configuration: Debug x64 ------
1>PCL_trial.cpp
1>Unknown compiler version - please run the configure tests and report the results
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C2039: 'type': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C2976: 'Eigen::Eigen::internal::traits': too few template arguments
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(18): message : see declaration of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C2039: 'StorageKind': is not a member of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(18): message : see declaration of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C3646: 'StorageKind': unknown override specifier
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C2039: 'Index': is not a member of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(18): message : see declaration of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C3646: 'Index': unknown override specifier
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(75,1): error C2144: syntax error: 'Eigen::Eigen::VectorBlock<VectorType,Size>' should be preceded by ';'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(74,5): error C7525: inline variables require at least '/std:c++17'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(75,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(86,1): error C2144: syntax error: 'Eigen::Eigen::VectorBlock<VectorType,Size>' should be preceded by ';'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(85,5): error C7525: inline variables require at least '/std:c++17'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(86,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,5): error C2976: 'Eigen::Eigen::internal::traits': too few template arguments
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(18): message : see declaration of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(95): message : see reference to class template instantiation 'Eigen::Transpose<Derived>' being compiled
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,5): error C2039: 'Scalar': is not a member of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(18): message : see declaration of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,1): error C3646: 'Scalar': unknown override specifier
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,1): error C2039: 'NumTraits': is not a member of 'Eigen::Eigen'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(14): message : see declaration of 'Eigen::Eigen'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,1): error C2059: syntax error: '<'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Diagonal.h(83,1): error C1003: error count exceeds 100; stopping compilation
1>Done building project "PCL_trial.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
更新:我已经下载了 PCL 1.9.1 并将其目录包含到我的项目中。我还下载了 Boost 1.70.0 来修复 positioning.hpp
的错误。我现在的问题是 low_level_io.h 的错误。以下是我在构建项目时遇到的错误:
1>PCL_trial.cpp
1>The use of BOOST_*_ENDIAN and BOOST_BYTE_ORDER is deprecated. Please include <boost/predef/other/endian.h> and use BOOST_ENDIAN_*_BYTE instead
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(60,16): error C2039: '_open': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(60,21): error C3861: '_open': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(70,16): error C2039: '_open': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(70,21): error C3861: '_open': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(80,16): error C2039: '_close': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(80,22): error C3861: '_close': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(90,16): error C2039: '_lseek': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(90,22): error C3861: '_lseek': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(100,16): error C2039: '_read': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(100,21): error C3861: '_read': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(110,16): error C2039: '_write': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(110,22): error C3861: '_write': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(120,16): error C2039: '_chsize': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(120,23): error C3861: '_chsize': identifier not found
1>Done building project "PCL_trial.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
有谁知道如何解决这个问题?任何帮助将不胜感激。
为了更简单,我建议您下载 all-in-one exe 文件并安装它,然后创建一个控制台 c++ 项目,手动添加 include 和 lib 文件。
我使用 CMake 和 PCL 1.9.1 成功构建了程序。显然,使用 CMake 更容易,因为它会自动添加必要的包含和库目录来构建程序。
我是 PCL(点云库)的新手,我试图构建一个简单的点云可视化代码,我在 Visual Studio 2019 年在他们的网站上找到了。当我尝试构建它,它给我在 PCL 文件夹中找到的头文件的错误。
我下载了 PCL 1.6,其中包含第 3 方头文件。我检查了我是否正确地包含了构建代码所需的必要目录,没有遗漏任何内容。我不确定如何处理这些错误,因为它们是由 PCL 库中包含的头文件引起的。任何帮助将不胜感激。
P.S。对于长代码和错误消息,我深表歉意。这是我第一次post在这里遇到问题。
下面是我在PCl网站上找到的简单点云可视化代码:
#include <pcl/visualization/cloud_viewer.h>
#include <iostream>
#include <pcl/io/io.h>
#include <pcl/io/pcd_io.h>
int user_data;
void
viewerOneOff(pcl::visualization::PCLVisualizer& viewer)
{
viewer.setBackgroundColor(1.0, 0.5, 1.0);
pcl::PointXYZ o;
o.x = 1.0;
o.y = 0;
o.z = 0;
viewer.addSphere(o, 0.25, "sphere", 0);
std::cout << "i only run once" << std::endl;
}
void
viewerPsycho(pcl::visualization::PCLVisualizer& viewer)
{
static unsigned count = 0;
std::stringstream ss;
ss << "Once per viewer loop: " << count++;
viewer.removeShape("text", 0);
viewer.addText(ss.str(), 200, 300, "text", 0);
//FIXME: possible race condition here:
user_data++;
}
int
main()
{
pcl::PointCloud<pcl::PointXYZRGBA>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGBA>);
pcl::io::loadPCDFile("my_point_cloud.pcd", *cloud);
pcl::visualization::CloudViewer viewer("Cloud Viewer");
//blocks until the cloud is actually rendered
viewer.showCloud(cloud);
//use the following functions to get access to the underlying more advanced/powerful
//PCLVisualizer
//This will only get called once
viewer.runOnVisualizationThreadOnce(viewerOneOff);
//This will get called once per visualization iteration
viewer.runOnVisualizationThread(viewerPsycho);
while (!viewer.wasStopped())
{
//you can also do cool processing here
//FIXME: Note that this is running in a separate thread from viewerPsycho
//and you should guard against race conditions yourself...
user_data++;
}
return 0;
}
这是导致错误的 PCL 文件夹中的头文件:
#ifndef EIGEN_VECTORBLOCK_H
#define EIGEN_VECTORBLOCK_H
namespace Eigen {
namespace internal {
template<typename VectorType, int Size>
struct traits<VectorBlock<VectorType, Size> >
: public traits<Block<VectorType,
traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
traits<VectorType>::Flags & RowMajorBit ? Size : 1> >
{
};
}
template<typename VectorType, int Size> class VectorBlock
: public Block<VectorType,
internal::traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
internal::traits<VectorType>::Flags & RowMajorBit ? Size : 1>
{
typedef Block<VectorType,
internal::traits<VectorType>::Flags & RowMajorBit ? 1 : Size,
internal::traits<VectorType>::Flags & RowMajorBit ? Size : 1> Base;
enum {
IsColVector = !(internal::traits<VectorType>::Flags & RowMajorBit)
};
public:
EIGEN_DENSE_PUBLIC_INTERFACE(VectorBlock)
using Base::operator=;
EIGEN_DEVICE_FUNC
inline VectorBlock(VectorType& vector, Index start, Index size)
: Base(vector,
IsColVector ? start : 0, IsColVector ? 0 : start,
IsColVector ? size : 1, IsColVector ? 1 : size)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock);
}
EIGEN_DEVICE_FUNC
inline VectorBlock(VectorType& vector, Index start)
: Base(vector, IsColVector ? start : 0, IsColVector ? 0 : start)
{
EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorBlock);
}
};
} // end namespace Eigen
#endif // EIGEN_VECTORBLOCK_H
下面是我在构建代码时不断收到的错误消息(我没有包含几行错误,因为我的 post 超出了字符数):
1>------ Build started: Project: PCL_trial, Configuration: Debug x64 ------
1>PCL_trial.cpp
1>Unknown compiler version - please run the configure tests and report the results
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C2039: 'type': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C2238: unexpected token(s) preceding ';'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C2976: 'Eigen::Eigen::internal::traits': too few template arguments
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(18): message : see declaration of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C2039: 'StorageKind': is not a member of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(18): message : see declaration of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C3646: 'StorageKind': unknown override specifier
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C2039: 'Index': is not a member of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(18): message : see declaration of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C3646: 'Index': unknown override specifier
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(68,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(75,1): error C2144: syntax error: 'Eigen::Eigen::VectorBlock<VectorType,Size>' should be preceded by ';'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(74,5): error C7525: inline variables require at least '/std:c++17'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(75,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(86,1): error C2144: syntax error: 'Eigen::Eigen::VectorBlock<VectorType,Size>' should be preceded by ';'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(85,5): error C7525: inline variables require at least '/std:c++17'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(86,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,5): error C2976: 'Eigen::Eigen::internal::traits': too few template arguments
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(18): message : see declaration of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(95): message : see reference to class template instantiation 'Eigen::Transpose<Derived>' being compiled
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,5): error C2039: 'Scalar': is not a member of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(18): message : see declaration of 'Eigen::Eigen::internal::traits'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,1): error C3646: 'Scalar': unknown override specifier
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,1): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,1): error C2039: 'NumTraits': is not a member of 'Eigen::Eigen'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\VectorBlock.h(14): message : see declaration of 'Eigen::Eigen'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Transpose.h(76,1): error C2059: syntax error: '<'
1>C:\Program Files\PCL 1.6.0rdParty\Eigen\include\Eigen\src\Core\Diagonal.h(83,1): error C1003: error count exceeds 100; stopping compilation
1>Done building project "PCL_trial.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
更新:我已经下载了 PCL 1.9.1 并将其目录包含到我的项目中。我还下载了 Boost 1.70.0 来修复 positioning.hpp
的错误。我现在的问题是 low_level_io.h 的错误。以下是我在构建项目时遇到的错误:
1>PCL_trial.cpp
1>The use of BOOST_*_ENDIAN and BOOST_BYTE_ORDER is deprecated. Please include <boost/predef/other/endian.h> and use BOOST_ENDIAN_*_BYTE instead
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(60,16): error C2039: '_open': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(60,21): error C3861: '_open': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(70,16): error C2039: '_open': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(70,21): error C3861: '_open': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(80,16): error C2039: '_close': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(80,22): error C3861: '_close': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(90,16): error C2039: '_lseek': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(90,22): error C3861: '_lseek': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(100,16): error C2039: '_read': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(100,21): error C3861: '_read': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(110,16): error C2039: '_write': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(110,22): error C3861: '_write': identifier not found
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(120,16): error C2039: '_chsize': is not a member of '`global namespace''
1>C:\Program Files\PCL 1.9.1\include\pcl-1.9\pcl\io\low_level_io.h(120,23): error C3861: '_chsize': identifier not found
1>Done building project "PCL_trial.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
有谁知道如何解决这个问题?任何帮助将不胜感激。
为了更简单,我建议您下载 all-in-one exe 文件并安装它,然后创建一个控制台 c++ 项目,手动添加 include 和 lib 文件。
我使用 CMake 和 PCL 1.9.1 成功构建了程序。显然,使用 CMake 更容易,因为它会自动添加必要的包含和库目录来构建程序。