一:無法解析的外部命令
#define vtkRenderingCore_AUTOINIT 3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL2)
VTK_MODULE_INIT(vtkRenderingOpenGL);
錯誤 1 error LNK2019: 無法解析的外部符號 "void __cdecl vtkRenderingOpenGL_AutoInit_Construct(void)" (?vtkRenderingOpenGL_AutoInit_Construct@@YAXXZ),該符號在函數 "public: __thiscall vtkRenderingOpenGL_ModuleInit::vtkRenderingOpenGL_ModuleInit(void)" (??0vtkRenderingOpenGL_ModuleInit@@QAE@XZ) 中被引用 E:\Visual Studio 2013\PCL_FPFH\PCL_FPFH\源.obj PCL_FPFH
錯誤 2 error LNK2019: 無法解析的外部符號 "void __cdecl vtkRenderingOpenGL_AutoInit_Destruct(void)" (?vtkRenderingOpenGL_AutoInit_Destruct@@YAXXZ),該符號在函數 "public: __thiscall vtkRenderingOpenGL_ModuleInit::~vtkRenderingOpenGL_ModuleInit(void)" (??1vtkRenderingOpenGL_ModuleInit@@QAE@XZ) 中被引用 E:\Visual Studio 2013\PCL_FPFH\PCL_FPFH\源.obj PCL_FPFH
錯誤原因:VTK版本的問題
解決方法:
VTK6.0之後版本使用如下語句初始化:
#include <vtkAutoInit.h> VTK_MODULE_INIT(vtkRenderingOpenGL)
VTK6.0之前版本使用如下語句初始化:
#define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeType,vtkRenderingOpenGL)
#define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL)
二:
error C4996: 'pcl::SAC_SAMPLE_SIZE': This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class
解決方法:打開項目屬性頁>C/C++>常規>SDL檢查(設置爲否)。 若上面的方法無法解決這個錯誤,可以打開頭文件”model_types.h”,修改其中的代碼:
namespace pcl
{
const static std::map<pcl::SacModel, unsigned int>
PCL_DEPRECATED("This map is deprecated and is kept only to prevent breaking "
"existing user code. Starting from PCL 1.8.0 model sample size "
"is a protected member of the SampleConsensusModel class")
SAC_SAMPLE_SIZE (sample_size_pairs, sample_size_pairs + sizeof (sample_size_pairs) / sizeof (SampleSizeModel));
}
修改後:
namespace pcl
{
const static std::map<pcl::SacModel, unsigned int>
//PCL_DEPRECATED("This map is deprecated and is kept only to prevent breaking "
//"existing user code. Starting from PCL 1.8.0 model sample size "
//"is a protected member of the SampleConsensusModel class")
SAC_SAMPLE_SIZE (sample_size_pairs, sample_size_pairs + sizeof (sample_size_pairs) / sizeof (SampleSizeModel));
}
三:
error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
解決方法:打開項目屬性頁>C/C++>預處理器,添加:_CRT_SECURE_NO_WARNINGS
四:
conditional_euclidean_clustering.obj : error LNK2001: 無法解析的外部符號 "public: void __cdecl pcl::ConditionalEuclideanClustering<struct pcl::PointXYZINormal>::segment(class std::vector<struct pcl::PointIndices,class std::allocator<struct pcl::PointIndices> > &)" (?segment@?$ConditionalEuclideanClustering@UPointXYZINormal@pcl@@@pcl@@QEAAXAEAV?$vector@UPointIndices@pcl@@V?$allocator@UPointIndices@pcl@@@std@@@std@@@Z)
1>conditional_euclidean_clustering.obj : error LNK2001: 無法解析的外部符號 "protected: virtual void __cdecl pcl::NormalEstimation<struct pcl::PointXYZI,struct pcl::PointXYZINormal>::computeFeature(class pcl::PointCloud<struct pcl::PointXYZINormal> &)" (?computeFeature@?$NormalEstimation@UPointXYZI@pcl@@UPointXYZINormal@2@@pcl@@MEAAXAEAV?$PointCloud@UPointXYZINormal@pcl@@@2@@Z)
1>E:\VisualStudio2013Project\PCLConsoleApplication\x64\Release\ConditionalEuclideanClustering.exe : fatal error LNK1120: 2 個無法解析的外部命令
解決方法:打開項目屬性頁>C/C++>預處理器,添加:PCL_NO_PRECOMPILE