Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/160.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ PCL和OSG库冲突_C++_Point Cloud Library_Openscenegraph_Conflicting Libraries - Fatal编程技术网

C++ PCL和OSG库冲突

C++ PCL和OSG库冲突,c++,point-cloud-library,openscenegraph,conflicting-libraries,C++,Point Cloud Library,Openscenegraph,Conflicting Libraries,所以我用PCL来做点云,用OpenSceneGraph来做可视化。PCL可视化非常糟糕,所以我自己做了。不管怎样,每当我试图使用这句话 pcl::io::savePCDFileBinary<pcl::PointXYZRGBA>(fname2,*cloud); pcl::io::savePCDFileBinary(fname2,*cloud); 事情发生了变化,我出现了以下错误 osgDBd.lib(osg80-osgDBd.dll) : error LNK2005: "publi

所以我用PCL来做点云,用OpenSceneGraph来做可视化。PCL可视化非常糟糕,所以我自己做了。不管怎样,每当我试图使用这句话

pcl::io::savePCDFileBinary<pcl::PointXYZRGBA>(fname2,*cloud);
pcl::io::savePCDFileBinary(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
osgDBd.lib(osg80 osgDBd.dll):错误LNK2005:“public:void\u thiscall std::basic\u of stream::close(void)”(?close@?$basic)_ofstream@DU?$char_traits@D@std@@@std@@qaexz)已在Recorder.obj中定义
2> osgDBd.lib(osg80 osgDBd.dll):错误LNK2005:“public:void\u thiscall std::basic\u of stream::`vbase destructor'(void)”(?\u D?$basic_ofstream@DU?$char_traits@D@std@@@std@@qaexz)已在Recorder.obj中定义
2> osgDBd.lib(osg80 osgDBd.dll):错误LNK2005:“public:bool_uthiscall std::basic_of stream::is_open(void)const”(?is_open@$basic_ofstream@DU?$char_traits@D@std@@@std@@QBE_NXZ)已在Recorder.obj中定义
2> osgDBd.lib(osg80 osgDBd.dll):错误LNK2005:“public:void_uthiscall std::basic_of stream::open(char const*,int,int)”(?open@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QAEXPBDHH@Z)已在Recorder.obj中定义
2> osgDBd.lib(osg80 osgDBd.dll):错误LNK2005:“public:u thiscall std::basic_of stream::basic_of stream(void)”(?0?$basic)_ofstream@DU?$char_traits@D@std@@@std@@QAE@XZ)已在Recorder.obj中定义
2> E:\Google Drive\Research\PCL\build\HandTracker\Debug\HandTracker.exe:致命错误LNK1169:找到一个或多个多重定义符号
我知道OSG和PCL中的IO文件相互冲突,尤其是ostream头。我的问题是如何解决这个问题?我需要将此语句用于中间文件保存、日志记录等。因此不使用它是不可能的,除非我想使用自己的方法,这有点像重新发明轮子

谢谢您的帮助


这里列出了几种解决方案。

是的,我见过。它确实提供了一种工作方法,但不是“正确”的方法。