From eabd08ef2544ac2d148ac6eddc2cb33e7025bd70 Mon Sep 17 00:00:00 2001 From: James Turner Date: Fri, 5 Aug 2016 13:16:07 +0100 Subject: [PATCH] Attempt to fix broken DLL exports from osgDB Only export the osgDB method implementations, instead of the entire class, and hence avoid exporting symbols from the base class, which then conflict with other compilation units when linking. This avoids the need for /FORCE:MULTIPLE linker option with MSVC. --- include/osgDB/fstream | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/osgDB/fstream b/include/osgDB/fstream index cb3c1bdcd..fb6f840aa 100644 --- a/include/osgDB/fstream +++ b/include/osgDB/fstream @@ -31,27 +31,27 @@ namespace osgDB void OSGDB_EXPORT open(std::fstream& fs, const char* filename,std::ios_base::openmode mode); -class OSGDB_EXPORT ifstream : public std::ifstream +class ifstream : public std::ifstream { public: - ifstream(); - explicit ifstream(const char* filename, + OSGDB_EXPORT ifstream(); + OSGDB_EXPORT explicit ifstream(const char* filename, std::ios_base::openmode mode = std::ios_base::in); - ~ifstream(); + OSGDB_EXPORT ~ifstream(); - void open(const char* filename, + void OSGDB_EXPORT open(const char* filename, std::ios_base::openmode mode = std::ios_base::in); }; -class OSGDB_EXPORT ofstream : public std::ofstream +class ofstream : public std::ofstream { public: - ofstream(); - explicit ofstream(const char* filename, + OSGDB_EXPORT ofstream(); + OSGDB_EXPORT explicit ofstream(const char* filename, std::ios_base::openmode mode = std::ios_base::out); - ~ofstream(); + OSGDB_EXPORT ~ofstream(); - void open(const char* filename, + void OSGDB_EXPORT open(const char* filename, std::ios_base::openmode mode = std::ios_base::out); };