そのため、点群には 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 ヘッダーで競合していることを知っています。私の質問は、どうすればこれを修正できますか? 中間ファイルの保存、ログ記録などにこのステートメントを使用する必要があるため、車輪の再発明のような独自の方法を使用したい場合を除き、使用しないことは問題外です。
助けてくれてありがとう