invalid use of incomplete type ‘std::ifstream in readNodeFile

kyungsoo hong chesed71 at gmail.com
Mon Sep 12 16:34:48 PDT 2016


Hi,

I'm newbie to osg, just installed and started 'hello world' with below code
osg::ref_ptr<osg::Node> root = osgDB::readNodeFile( std::string("cessna.osg" ));

but I got error  like this
In file included from /osgTester/main.cpp:2:0:

/usr/local/include/osgDB/fstream:34:30: error: invalid use of incomplete type ‘std::ifstream {aka class std::basic_ifstream<char>}’
 class ifstream : public std::ifstream
                              ^
In file included from /usr/include/c++/5/ios:38:0,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /home/osgTester/main.cpp:1:
/usr/include/c++/5/iosfwd:116:11: note: declaration of ‘std::ifstream {aka class std::basic_ifstream<char>}’
     class basic_ifstream;

using osg 3.4 on Ubuntu 16.04

Thank you!

Cheers,
kyungsoo

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=68586#68586








More information about the osg-users mailing list