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

2016-08-19 Thread Nickolai Medvedev
Hi, guys!

Let's remember, what exactly it std::fstream:

typedef basic_ifstream< char, char_traits< char > > ifstream;
typedef basic_ofstream< char, char_traits< char > > ofstream;
typedef basic_fstream< char, char_traits< char > > fstream;

So, if problem is names, maybe do something like:

typedef basic_ifstream< char, char_traits< char > > osg_ifstream;

or to inherit osgDB:: fstream from std::basic_fstream< char, std::char_traits< 
char > >.

Sorry, i have no time that to check it.

Cheers,
Nickolai

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-17 Thread Robert Osfield
HI James,

On 17 August 2016 at 10:16, James Turner  wrote:
>> Would this change not modify the ABI?
>
> Yes, it would - I didn’t realise ABI compatibility was a goal of the stable 
> branches.

If we can maintain the ABI through stable branches then this is what I
aim to do.

We can't always maintain it as bug fixes sometimes require fixes to
member/methods that break the ABI.

I'm working to get OSG-3.6 out as soon as I can so hopefully this can
wrap up the fix for end users.  The only major feature I have left to
nail down for 3.6 is VAO support.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-17 Thread James Turner

> On 16 Aug 2016, at 13:26, Robert Osfield  wrote:
> 
> Would this change not modify the ABI?

Yes, it would - I didn’t realise ABI compatibility was a goal of the stable 
branches.

Kind regards,
James
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-16 Thread Robert Osfield
On 16 August 2016 at 13:02, James Turner  wrote:
>
>> On 16 Aug 2016, at 12:47, Robert Osfield  wrote:
>>
>> Thanks now merged into git master.
>
> Thanks! We use the 3.4 branch for FlightGear at the moment - can you 
> cherry-pick the fix there or would you prefer another pull request?

Would this change not modify the ABI?

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-16 Thread James Turner

> On 16 Aug 2016, at 12:47, Robert Osfield  wrote:
> 
> Thanks now merged into git master.

Thanks! We use the 3.4 branch for FlightGear at the moment - can you 
cherry-pick the fix there or would you prefer another pull request?

Kind regards,
James

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-16 Thread Robert Osfield
On 15 August 2016 at 22:30, James Turner  wrote:
>
>> On 9 Aug 2016, at 10:21, Robert Osfield  wrote:
>>
>> I'm happy to merge the changes, could you raise a pull request based
>> on these changes?
>
> https://github.com/openscenegraph/OpenSceneGraph/pull/115

Thanks now merged into git master.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-15 Thread James Turner

> On 9 Aug 2016, at 10:21, Robert Osfield  wrote:
> 
> I'm happy to merge the changes, could you raise a pull request based
> on these changes?

https://github.com/openscenegraph/OpenSceneGraph/pull/115

Kind regards,
James

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-11 Thread Nickolai Medvedev
Hi, guys!

The fix works! I had linker error at integration of MYGUI associated
with fstream, now everything is all right. Thank you!

Cheers,
Nickolai

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-09 Thread Robert Osfield
Hi James,

On 9 August 2016 at 09:08, James Turner  wrote:
> I would prefer to fix the underlying issue in osgDB, rather than finding 
> better work-arounds. My intuition, but as a non-Windows user it may be wrong, 
> is that exporting the ctor / dtor for a class you don’t ‘own’ in a DLL is not 
> recommended practice. Again, assuming my change does what I think it does in 
> terms of preserving the behaviour and linkage against osgDB for the 
> implementations of the osgDB wrapper classes.

I'd rather fix the issue directly rather than have a workaround as well.

I'm happy to merge the changes, could you raise a pull request based
on these changes?

Cheers,
Robert
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-09 Thread James Turner

> On 8 Aug 2016, at 09:57, Trajce Nikolov NICK  
> wrote:
> 
> 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
> 

I would prefer to fix the underlying issue in osgDB, rather than finding better 
work-arounds. My intuition, but as a non-Windows user it may be wrong, is that 
exporting the ctor / dtor for a class you don’t ‘own’ in a DLL is not 
recommended practice. Again, assuming my change does what I think it does in 
terms of preserving the behaviour and linkage against osgDB for the 
implementations of the osgDB wrapper classes.

Kind regards,
James

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-08 Thread Trajce Nikolov NICK
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.messerschm...@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  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@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
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-08-08 Thread Sebastian Messerschmidt

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 
 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/2098c022283f1afeb4bad0ffb4b682b884cc8f32

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@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


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

2016-08-07 Thread James Turner
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  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/2098c022283f1afeb4bad0ffb4b682b884cc8f32

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@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org