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

kyungsoo hong chesed71 at gmail.com
Tue Sep 13 08:37:13 PDT 2016


Hi,

this is the whole code 
#include <iostream>
#include <osgDB/ReadFile>
#include <osgViewer/Viewer>

int main() {
    osg::ref_ptr<osg::Node> root = osgDB::readNodeFile( std::string("cessna.osg" ));

    osgViewer::Viewer viewer;
    viewer.setSceneData( root.get() );
    return viewer.run();
}

and using cmake with below CMakeList

cmake_minimum_required(VERSION 3.6)
project(osgTester)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

INCLUDE_DIRECTORIES(/usr/local/include/osg)
INCLUDE_DIRECTORIES(/usr/local/include/OpenThreads)
INCLUDE_DIRECTORIES(/usr/local/include/osgViewer)
INCLUDE_DIRECTORIES(/usr/local/include/osgDB)
INCLUDE_DIRECTORIES(/usr/local/include/osgUtil)
LINK_DIRECTORIES(/usr/local/lib64/)

add_executable(osgTester main.cpp)
TARGET_LINK_LIBRARIES(osgTester osg OpenThreads osgViewer osgDB osgUtil)



Thank you!

Cheers,
kyungsoo

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








More information about the osg-users mailing list