[osg-users] Potential fix for osgDB MSVC linkage issues (FORCE:MULTIPLE needed)

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Mon Aug 8 01:57:19 PDT 2016


Hi,

this was discussed while ago for different versions of Visual Studio and
there was a work around (which was not forcing to use force:multiple).
Might be worth to look in the archive

On Mon, Aug 8, 2016 at 10:52 AM, Sebastian Messerschmidt <
sebastian.messerschmidt at gmx.de> wrote:

> Hi James,
>
> I haven't dived into the details yet, but I strongly advertise for a fix,
> since this is a great polluter in our build-process too (Visual studio
> doesn't let you filter some warnings).
>
>
> Cheers
> Sebastian
>
>
> Hello,
>>
>> With recent MSVC versions, we’re obliged to use /FORCE_:MULTIPLE, to work
>> around the fact that osgDB.lib includes symbols from std::fstream classes,
>> which then causes conflicts when other object files in a target (eg
>> executable) being linked use <fstream> classes. This slows down linking
>> since incremental linking is disabled, and makes our build output very
>> noisy.
>>
>> After some discussion, I came up with the following fix:
>>
>>         https://github.com/zakalawe/osg/commit/2098c022283f1afeb4bad
>> 0ffb4b682b884cc8f32
>>
>> The idea is to only export the non-inlined symbols from osgDB::ofstream
>> and ::ifstream, but not to export the entire class, since doing so forces
>> MSVC to also export the constructor and destructor for the base class
>> (std::ofstream and std::ifstream).
>>
>> Since we don’t use the osgDB versions of fstream in FlightGear, I can’t
>> check if this is backwards compatible for other Windows OSG users, but I am
>> hopeful that it is, and hence that this approach could be upstreamed.
>>
>> Kind regards,
>> James
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160808/408783dd/attachment-0003.htm>


More information about the osg-users mailing list