Re: [osg-users] osgDB ifstream / ofstream conflict
Hi, so far, /FORCE:multiple has worked for me. Thank you! Cheers, Florian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56555#56555 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi, I am now running against the same issue. I checked to see that everything is compiled with /MD. I'm trying to build osg 3.2.0 x64 with VS2012 - 3rd-Party Binaries from: www.helleboreconsulting.com/index.php/open-source/openscenegraph - OSG built by myself - my project runs into: Code: 4* CIL library *(* CIL module *) : error LNK2005: public: void __cdecl std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ) already defined in osgDBrd.lib(osg100-osgDBrd.dll) 4* CIL library *(* CIL module *) : error LNK2005: public: void __cdecl std::basic_ofstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ) already defined in osgDBrd.lib(osg100-osgDBrd.dll) 4..\..\..\setup\bin\sphinx-api3d-lib.dll : fatal error LNK1169: one or more multiply defined symbols found Interestingly - it is again osgDB... Regards, Florian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56501#56501 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi Florian, You can get around the fatal error by adding /FORCE: MULTIPLE to your linker options. This seems to be some odd VS2010 and beyond conformance problem. Basically I get this error in almost any application linking to osgDB and using fstream. It is somehow related to the derived stream class and its virtual functions. cheers Sebastian Hi, I am now running against the same issue. I checked to see that everything is compiled with /MD. I'm trying to build osg 3.2.0 x64 with VS2012 - 3rd-Party Binaries from: www.helleboreconsulting.com/index.php/open-source/openscenegraph - OSG built by myself - my project runs into: Code: 4* CIL library *(* CIL module *) : error LNK2005: public: void __cdecl std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QEAAXXZ) already defined in osgDBrd.lib(osg100-osgDBrd.dll) 4* CIL library *(* CIL module *) : error LNK2005: public: void __cdecl std::basic_ofstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ofstream@DU?$char_traits@D@std@@@std@@QEAAXXZ) already defined in osgDBrd.lib(osg100-osgDBrd.dll) 4..\..\..\setup\bin\sphinx-api3d-lib.dll : fatal error LNK1169: one or more multiply defined symbols found Interestingly - it is again osgDB... Regards, Florian -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56501#56501 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgDB ifstream / ofstream conflict
I had the same problem with VS2010 and there are two ways to get around it. 1. Use /FORCE:multiple 2. Create a typdef: Code: #pragma once // Compatibility layer for VS2010 bug. The compiler tries to link the same // multiple symbols in for the OSG fstream classes which inherit from the STL // classes. The workaround is to use OSG fstream classes in all places rather // than STL. #ifdef WIN32 // Replace STL fstream with OSG fstream #include osgDB/fstream #define ifstream osgDB::ifstream #define ofstream osgDB::ofstream #else #include fstream #define ifstream std::ifstream #define ofstream std::ofstream Cheers, Braden -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56510#56510 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi Vincent, I have been using Visual Studio 2010 and fstreams and OSG DLLs with no issues at all. The only possibility is you are compiling with incompatible compiler options between OSG and your other library. All files must be compiled /MD(d) and of course compiled with Visual Studio 2010. Make sure to include fstream not fstream.h etc You have not found a bug in Visual Studio 2010, I can guarantee that. Andrew -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39488#39488 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi, yes, adding /FORCE:MULTIPLE to the linker command line was the only workaround I found Regards, -Fred - Brad Christiansen a écrit : Hi, This seems to be the same / related to an issue raised some time ago with VS2010. When I build VirtualPlanetBuilder with VS2010 I get errors complaining about duplicate definitions of the stream destructors (cant remember the details of hand). The same code works without issue on non-windows platforms and all other VS compilers tried. As I don't have time to look into the issue I simply force the link to complete with multiply defined symbols. A quick search through my local OSG-users archive found the thread + message included bellow. Do a search through the archives around this topic and you should find all the details. Cheers, Brad Re: [osg-users] OT: VS2010 LNK2005 problem related to ostringstream Ok, I have localized the problem. For example, the class osgDB::fstream: class OSGDB_EXPORT fstream : public std::fstream { }; which just inherits from std:.fstream causes the symbols of std::fstream to be exposed into osgDB.dll This effectively means that It might cause problems for people linking against osgDB.dll later on. Same goes for inheriting from std::string, std::ostringstream etc. This must obviously be a bug, a very serious one in VS2010. We had a class derived from std::ostringstream, which exposed the symbols in the vtable for the class: namespace ns { class Notify : public std::ostringstream { }; } Using depends.exe to analyze the dll-file gives: const ns::Notify::`vftable'{for `std::basic_ostringstreamchar,struct std::char_traitschar,class std::allocatorchar '} My issue was reported to the msdn forum. Their first take was: Oh you use CMake, thats not our product :-) But in later threads, they tried to reproduce the problem without luck... So if you manage to reproduce this in a small example, go ahead and post it. We must make them aware of this problem. http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/191de00a-53c9-4bd9-9cb6-e844eb224ca2 /Anders From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Vincent Bourdier Sent: Wednesday, 27 April 2011 11:47 PM To: osg user Subject: Re: [osg-users] osgDB ifstream / ofstream conflict Hi, Sorry to insist but I would appreciate any advices about this issue. Maybe I'm the only one who encountered it, but the patch I did is not so... clean to my mind... Thanks. Regards, Vincent. Le 21/04/2011 14:50, Vincent Bourdier a écrit : Hi all, I just found a fix after some tests, but it is not a fix I am proud of. I just added the close() method in osgDB/fstream implementation, so there is no conflict because my fstream implementation uses osgDB/fstream and not osgDB/fstream AND std::fstream. I will continue to investigate to be sure to understand why this occurs, but any advices or explanations are welcome. If my fix is accepted this could be a submission for OSG, eventually... Thanks. Regards, Vincent. Le 20/04/2011 14:54, Vincent Bourdier a écrit : Hi Mourad Thanks for your answer but I already checked that. TsLib_MDdNET2010 is a static lib but linked with /MD(d), like my application... Vincent. Le 20/04/2011 11:50, Mourad Boufarguine a écrit : Hi Vincent, On Mon, Apr 4, 2011 at 4:36 PM, Vincent Bourdier vincent.bourd...@gmail.com wrote: 2TsLib_MDdNET2010.lib(IwPoly.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) 2TsLib_MDdNET2010.lib(IwBrepData.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) It seems like a static/dynamic c++ runtime conflict. Check if osg and TsLib_MDdNET2010 are linked against the same type of c++ runtime (both with /MTd flag or both with /MDd flag) Mourad DISCLAIMER:--- This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi, But what is the best solution ? I just have some hesitation to modify the linker settings instead of solving the problem for real... but if it is the best way... Regards, Vincent Le 29/04/2011 15:23, Frederic Bouvier a écrit : Hi, yes, adding /FORCE:MULTIPLE to the linker command line was the only workaround I found Regards, -Fred - Brad Christiansen a écrit : Hi, This seems to be the same / related to an issue raised some time ago with VS2010. When I build VirtualPlanetBuilder with VS2010 I get errors complaining about duplicate definitions of the stream destructors (cant remember the details of hand). The same code works without issue on non-windows platforms and all other VS compilers tried. As I don't have time to look into the issue I simply force the link to complete with multiply defined symbols. A quick search through my local OSG-users archive found the thread + message included bellow. Do a search through the archives around this topic and you should find all the details. Cheers, Brad Re: [osg-users] OT: VS2010 LNK2005 problem related to ostringstream Ok, I have localized the problem. For example, the class osgDB::fstream: class OSGDB_EXPORT fstream : public std::fstream { }; which just inherits from std:.fstream causes the symbols of std::fstream to be exposed into osgDB.dll This effectively means that It might cause problems for people linking against osgDB.dll later on. Same goes for inheriting from std::string, std::ostringstream etc. This must obviously be a bug, a very serious one in VS2010. We had a class derived from std::ostringstream, which exposed the symbols in the vtable for the class: namespace ns { class Notify : public std::ostringstream { }; } Using depends.exe to analyze the dll-file gives: const ns::Notify::`vftable'{for `std::basic_ostringstreamchar,struct std::char_traitschar,class std::allocatorchar '} My issue was reported to the msdn forum. Their first take was: Oh you use CMake, thats not our product :-) But in later threads, they tried to reproduce the problem without luck... So if you manage to reproduce this in a small example, go ahead and post it. We must make them aware of this problem. http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/191de00a-53c9-4bd9-9cb6-e844eb224ca2 /Anders From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Vincent Bourdier Sent: Wednesday, 27 April 2011 11:47 PM To: osg user Subject: Re: [osg-users] osgDB ifstream / ofstream conflict Hi, Sorry to insist but I would appreciate any advices about this issue. Maybe I'm the only one who encountered it, but the patch I did is not so... clean to my mind... Thanks. Regards, Vincent. Le 21/04/2011 14:50, Vincent Bourdier a écrit : Hi all, I just found a fix after some tests, but it is not a fix I am proud of. I just added the close() method in osgDB/fstream implementation, so there is no conflict because my fstream implementation uses osgDB/fstream and not osgDB/fstream AND std::fstream. I will continue to investigate to be sure to understand why this occurs, but any advices or explanations are welcome. If my fix is accepted this could be a submission for OSG, eventually... Thanks. Regards, Vincent. Le 20/04/2011 14:54, Vincent Bourdier a écrit : Hi Mourad Thanks for your answer but I already checked that. TsLib_MDdNET2010 is a static lib but linked with /MD(d), like my application... Vincent. Le 20/04/2011 11:50, Mourad Boufarguine a écrit : Hi Vincent, On Mon, Apr 4, 2011 at 4:36 PM, Vincent Bourdier vincent.bourd...@gmail.com wrote: 2TsLib_MDdNET2010.lib(IwPoly.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) 2TsLib_MDdNET2010.lib(IwBrepData.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) It seems like a static/dynamic c++ runtime conflict. Check if osg and TsLib_MDdNET2010 are linked against the same type of c++ runtime (both with /MTd flag or both with /MDd flag) Mourad DISCLAIMER:--- This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi, This seems to be the same / related to an issue raised some time ago with VS2010. When I build VirtualPlanetBuilder with VS2010 I get errors complaining about duplicate definitions of the stream destructors (cant remember the details of hand). The same code works without issue on non-windows platforms and all other VS compilers tried. As I don't have time to look into the issue I simply force the link to complete with multiply defined symbols. A quick search through my local OSG-users archive found the thread + message included bellow. Do a search through the archives around this topic and you should find all the details. Cheers, Brad Re: [osg-users] OT: VS2010 LNK2005 problem related to ostringstream Ok, I have localized the problem. For example, the class osgDB::fstream: class OSGDB_EXPORT fstream : public std::fstream { }; which just inherits from std:.fstream causes the symbols of std::fstream to be exposed into osgDB.dll This effectively means that It might cause problems for people linking against osgDB.dll later on. Same goes for inheriting from std::string, std::ostringstream etc. This must obviously be a bug, a very serious one in VS2010. We had a class derived from std::ostringstream, which exposed the symbols in the vtable for the class: namespace ns { class Notify : public std::ostringstream { }; } Using depends.exe to analyze the dll-file gives: const ns::Notify::`vftable'{for `std::basic_ostringstreamchar,struct std::char_traitschar,class std::allocatorchar '} My issue was reported to the msdn forum. Their first take was: Oh you use CMake, thats not our product :-) But in later threads, they tried to reproduce the problem without luck... So if you manage to reproduce this in a small example, go ahead and post it. We must make them aware of this problem. http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/191de00a-53c9-4bd9-9cb6-e844eb224ca2 /Anders From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Vincent Bourdier Sent: Wednesday, 27 April 2011 11:47 PM To: osg user Subject: Re: [osg-users] osgDB ifstream / ofstream conflict Hi, Sorry to insist but I would appreciate any advices about this issue. Maybe I'm the only one who encountered it, but the patch I did is not so... clean to my mind... Thanks. Regards, Vincent. Le 21/04/2011 14:50, Vincent Bourdier a écrit : Hi all, I just found a fix after some tests, but it is not a fix I am proud of. I just added the close() method in osgDB/fstream implementation, so there is no conflict because my fstream implementation uses osgDB/fstream and not osgDB/fstream AND std::fstream. I will continue to investigate to be sure to understand why this occurs, but any advices or explanations are welcome. If my fix is accepted this could be a submission for OSG, eventually... Thanks. Regards, Vincent. Le 20/04/2011 14:54, Vincent Bourdier a écrit : Hi Mourad Thanks for your answer but I already checked that. TsLib_MDdNET2010 is a static lib but linked with /MD(d), like my application... Vincent. Le 20/04/2011 11:50, Mourad Boufarguine a écrit : Hi Vincent, On Mon, Apr 4, 2011 at 4:36 PM, Vincent Bourdier vincent.bourd...@gmail.commailto:vincent.bourd...@gmail.com wrote: 2TsLib_MDdNET2010.lib(IwPoly.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) 2TsLib_MDdNET2010.lib(IwBrepData.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) It seems like a static/dynamic c++ runtime conflict. Check if osg and TsLib_MDdNET2010 are linked against the same type of c++ runtime (both with /MTd flag or both with /MDd flag) Mourad DISCLAIMER:--- This e-mail transmission and any documents, files and previous e-mail messages attached to it are private and confidential. They may contain proprietary or copyright material or information that is subject to legal professional privilege. They are for the use of the intended recipient only. Any unauthorised viewing, use, disclosure, copying, alteration, storage or distribution of, or reliance on, this message is strictly prohibited. No part may be reproduced, adapted or transmitted without the written permission of the owner. If you have received this transmission in error, or are not an authorised recipient, please immediately notify the sender by return email, delete this message and all copies from your e-mail system, and destroy any printed copies. Receipt by anyone other than the intended recipient should not be deemed a waiver of any privilege
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi, Sorry to insist but I would appreciate any advices about this issue. Maybe I'm the only one who encountered it, but the patch I did is not so... clean to my mind... Thanks. Regards, Vincent. Le 21/04/2011 14:50, Vincent Bourdier a écrit : Hi all, I just found a fix after some tests, but it is not a fix I am proud of. I just added the close() method in osgDB/fstream implementation, so there is no conflict because my fstream implementation uses osgDB/fstream and not osgDB/fstream AND std::fstream. I will continue to investigate to be sure to understand why this occurs, but any advices or explanations are welcome. If my fix is accepted this could be a submission for OSG, eventually... Thanks. Regards, Vincent. Le 20/04/2011 14:54, Vincent Bourdier a écrit : Hi Mourad Thanks for your answer but I already checked that. TsLib_MDdNET2010 is a static lib but linked with /MD(d), like my application... Vincent. Le 20/04/2011 11:50, Mourad Boufarguine a écrit : Hi Vincent, On Mon, Apr 4, 2011 at 4:36 PM, Vincent Bourdier vincent.bourd...@gmail.com mailto:vincent.bourd...@gmail.com wrote: 2TsLib_MDdNET2010.lib(IwPoly.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) 2TsLib_MDdNET2010.lib(IwBrepData.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) It seems like a static/dynamic c++ runtime conflict. Check if osg and TsLib_MDdNET2010 are linked against the same type of c++ runtime (both with /MTd flag or both with /MDd flag) Mourad ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi all, I just found a fix after some tests, but it is not a fix I am proud of. I just added the close() method in osgDB/fstream implementation, so there is no conflict because my fstream implementation uses osgDB/fstream and not osgDB/fstream AND std::fstream. I will continue to investigate to be sure to understand why this occurs, but any advices or explanations are welcome. If my fix is accepted this could be a submission for OSG, eventually... Thanks. Regards, Vincent. Le 20/04/2011 14:54, Vincent Bourdier a écrit : Hi Mourad Thanks for your answer but I already checked that. TsLib_MDdNET2010 is a static lib but linked with /MD(d), like my application... Vincent. Le 20/04/2011 11:50, Mourad Boufarguine a écrit : Hi Vincent, On Mon, Apr 4, 2011 at 4:36 PM, Vincent Bourdier vincent.bourd...@gmail.com mailto:vincent.bourd...@gmail.com wrote: 2TsLib_MDdNET2010.lib(IwPoly.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) 2TsLib_MDdNET2010.lib(IwBrepData.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) It seems like a static/dynamic c++ runtime conflict. Check if osg and TsLib_MDdNET2010 are linked against the same type of c++ runtime (both with /MTd flag or both with /MDd flag) Mourad ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi all, No advices or ideas ? Am I the only one this this issue Regards, Vincent Le 04/04/2011 17:36, Vincent Bourdier a écrit : Hi all, I've an issue concerning the std::ifstream in my application. I know that I need to use osgDB::ifstream instead of std::ifstream and I did everywhere in my code. But, my project links with an other lib than OSG, and this library is using std::ifstream and std::ofstream, and this results in thing like that (using VS2010 and OSG 2.8.3) : 2TsLib_MDdNET2010.lib(IwPoly.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) 2TsLib_MDdNET2010.lib(IwBrepData.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) Do you have any suggestion to fix this issue ? Thanks for your help, Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi Vincent, On Mon, Apr 4, 2011 at 4:36 PM, Vincent Bourdier vincent.bourd...@gmail.com wrote: 2TsLib_MDdNET2010.lib(IwPoly.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) 2TsLib_MDdNET2010.lib(IwBrepData.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) It seems like a static/dynamic c++ runtime conflict. Check if osg and TsLib_MDdNET2010 are linked against the same type of c++ runtime (both with /MTd flag or both with /MDd flag) Mourad ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgDB ifstream / ofstream conflict
Hi Mourad Thanks for your answer but I already checked that. TsLib_MDdNET2010 is a static lib but linked with /MD(d), like my application... Vincent. Le 20/04/2011 11:50, Mourad Boufarguine a écrit : Hi Vincent, On Mon, Apr 4, 2011 at 4:36 PM, Vincent Bourdier vincent.bourd...@gmail.com mailto:vincent.bourd...@gmail.com wrote: 2TsLib_MDdNET2010.lib(IwPoly.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) 2TsLib_MDdNET2010.lib(IwBrepData.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) It seems like a static/dynamic c++ runtime conflict. Check if osg and TsLib_MDdNET2010 are linked against the same type of c++ runtime (both with /MTd flag or both with /MDd flag) Mourad ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgDB ifstream / ofstream conflict
Hi all, I've an issue concerning the std::ifstream in my application. I know that I need to use osgDB::ifstream instead of std::ifstream and I did everywhere in my code. But, my project links with an other lib than OSG, and this library is using std::ifstream and std::ofstream, and this results in thing like that (using VS2010 and OSG 2.8.3) : 2TsLib_MDdNET2010.lib(IwPoly.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) 2TsLib_MDdNET2010.lib(IwBrepData.obj) : error LNK2005: public: void __thiscall std::basic_ifstreamchar,struct std::char_traitschar ::close(void) (?close@?$basic_ifstream@DU?$char_traits@D@std@@@std@@QAEXXZ) already defined in osgDBd.lib(osg65-osgDBd.dll) Do you have any suggestion to fix this issue ? Thanks for your help, Regards, Vincent. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org