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

Mike Metcalf metcalfnospam at mac.com
Wed Sep 14 15:23:25 PDT 2016


kyungsoo,

I skimmed over most of the details of this thread, so please forgive me if this is of no help, but we had a similar problem and fixed it by adding the following to one of our CMakeLists.txt:


Code:

# AVOID DUMB MSVC MULTIPLE INCLUSION ERROR WITH OSGBD
# This relates to derivation of osgDB::ifstream from std::ifstream.
# Allowing the multiple inclusion creates a linker warning.
# For more info on the issue:
# google: osgdb ifstream multiple definition
# http://forum.openscenegraph.org/viewtopic.php?p=50916#50916
# http://forum.openscenegraph.org/viewtopic.php?t=12913&view=next
# https://groups.google.com/forum/#!topic/osg-users/xneWFpi9wI0
if(MSVC)
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FORCE:multiple")
endif()




Please note in those comments the forum posts that discuss the problem in greater detail.

I do hope this helps.

-Mike Metcalf

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








More information about the osg-users mailing list