0

所以我将 PCL 用于点云,使用 OpenSceneGraph 进行可视化。PCL 可视化非常糟糕,所以我自己制作了。无论如何,每当我尝试使用此语句时

pcl::io::savePCDFileBinary<pcl::PointXYZRGBA>(fname2,*cloud);

事情破裂了,我收到以下错误

osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "public: void __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::close(void)" (?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in Recorder.obj
2>osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "public: void __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::`vbase destructor'(void)" (??_D?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in Recorder.obj
2>osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "public: bool __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::is_open(void)const " (?is_open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ) already defined in Recorder.obj
2>osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "public: void __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::open(char const *,int,int)" (?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z) already defined in Recorder.obj
2>osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "public: __thiscall std::basic_ofstream<char,struct std::char_traits<char> >::basic_ofstream<char,struct std::char_traits<char> >(void)" (??0?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ) already defined in Recorder.obj
2>E:\Google Drive\Research\PCL\build\HandTracker\Debug\HandTracker.exe : fatal error LNK1169: one or more multiply defined symbols found

我知道 OSG 和 PCL 中的 IO 文件特别是 ostream 标头冲突。我的问题是我该如何解决这个问题?我需要将此语句用于中间文件保存、日志记录等,所以不使用它是不可能的,除非我想使用我自己的方法,这有点像重新发明轮子。

谢谢你的帮助

4

1 回答 1

1

http://forum.openscenegraph.org/viewtopic.php?t=8099

那里概述了几种解决方案。

于 2014-11-19T17:17:19.490 回答