安胖胖 发表于 2017-9-29 10:33:55

OSG ifstream及ofstream错误

我是在ubuntu下搭建的qt5.9.1+osg3.2.2的环境,我在尝试进行osg编译时出现这样的错误
/usr/local/include/osgDB/fstream:35: error: invalid use of incomplete type ‘std::ifstream {aka class std::basic_ifstream<char>}’
class OSGDB_EXPORT ifstream : public std::ifstream
                                           ^
以及
/usr/local/include/osgDB/fstream:47: error: invalid use of incomplete type ‘std::ofstream {aka class std::basic_ofstream<char>}’
class OSGDB_EXPORT ofstream : public std::ofstream
                                           ^
各位大佬有没有解决的办法啊

下面是我找到的代码,但是我觉得我的代码肯定没问题啊


#include<QApplication>

#include<osgDB/ReadFile>

#include<osgViewer/Viewer>

int main()

{

osgViewer::Viewer viewer;

viewer.setSceneData(osgDB::readNodeFile("/home/pangpang/OpenSceneGraph-3.2.2/cow.osg"));

viewer.realize();

viewer.run();

}
页: [1]
查看完整版本: OSG ifstream及ofstream错误