Boost logo

Boost :

Subject: Re: [boost] [Locale] Static locale initialisation
From: Artyom (artyomtnk_at_[hidden])
Date: 2010-04-08 16:25:05


I've notices something right now:

>
> __PURE_APPDOMAIN_GLOBAL static std::locale::_Locimp
> *global_locale = 0; //
> pointer to current locale
>

Ok, this is interesting point... Make sure that all DLLs you are using
are compiled correctly with Same MSVC runtime **DLL** (with correct import
flags) and not mixed DLL/static library/

Because if they are not, there may be more then one instance of

std::locale::_Locimp *global_locale = 0;

If it was not exported!

    foo.dll -> uses dllexported std::locale::_Locimp *global_locale
    bar.dll -> uses dllexported std::locale::_Locimp *global_locale
    baz.dll -> do not import symbol of std::locale::_Locimp *global_locale
           and uses its own version.

And you end with two static variables that are not merged... It is
very unplesant issue (which makes me love ELF and shared objects ;-) ).

When using Boost.Locale or any std::locale faces on your own
you must make sure that all DLLs and libraries same MSVC DLL. Otherwise...
wellcome to hell.

Artyom

      


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk