openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] Strange issue with half and _toFloat array.


From: Simon Smith
Subject: Re: [Openexr-devel] Strange issue with half and _toFloat array.
Date: Thu, 13 Feb 2014 15:50:16 +0000

After looking at the comments in createDLL.cpp, I wonder if this is the problem?

----------------------
Extra Magic: static member variables

This program does not fix the problem that the MS dynamic loader can't
resolve static member variables of classes properly. This issue will be
the most important thing to watch out for.

example -
class Foo
{
public:
static int bar;
};

the dynamic loader puts bar in the wrong memory space. This is a fundamental
problem with the architecture of DLL's. There is no workaround, except to
change the code; example, in the header file -

#ifdef MSC_VER
extern __declspec(dllexport) int foo_bar;
#endif

and in the .cpp file,

#ifdef MSC_VER
__declspec(dllexport) int foo_bar;
#endif

You'll get multiple declarations of foo_bar, but the linker will resolve
them down to one when the DLL is linked.
----------------------

If this is relevant, anyone any ideas how to solve it?
I could just move to using statically linked libraries of course I guess …..



Best Regards,
   Simon


On 13 Feb 2014, at 15:34, Simon Smith wrote:

Sorry, that's just a type in the email Paul :)
Why did I not just copy and paste I do not know!

The crash happens in accessing the _toFloat array … I'm thinking the static data is not being loaded with the DLL for some reason ...


Best Regards,
   Simon

On 13 Feb 2014, at 15:17, Paul Miller wrote:

On 2/13/2014 8:03 AM, Simon Smith wrote:
I was having issues with half/floats in my application, so I wrote a
quick test command line app to check everything was OK.
Not unsurprisingly, it was not!

This was the code …
...
assert(fRes = 4.0f);

Are you it's not just your assignment (typo?) in the assert?


_______________________________________________
Openexr-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/openexr-devel

_______________________________________________
Openexr-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/openexr-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]