[Development] ICU and Windows

Yves Bailly yves.bailly at sescoi.fr
Mon Jan 14 08:31:19 CET 2013


Le 11/01/2013 16:50, Thiago Macieira a écrit :
> On sexta-feira, 11 de janeiro de 2013 13.32.35, Shaw Andy wrote:
>> Unfortunately this is what is happening now if ICU is linked in, ICU will
>> always use the release version so if Qt is built in debug mode then it will
>> end up mixing the C runtime libraries.
>
> As far as I know, mixing C++ (not C!) runtime libraries is permitted, provided
> that certain care is taken, especially that the runtime that allocated memory
> must be the one to free it.

Which is not always that easy... if a library function returns, say, an simple
std::string *by value*, then who will destroy the allocated memory? It's really
too easy to break something, somwhere, causing a random crash almost impossible
to reproduce reliably.

For what it worths, for years in my job we've been taking the greatest care to
avoid mixing runtimes at all cost, requiring "external" library providers to
provide debug builds of their libraries. By applying this rule, a whole set of
random, very hard-to-track crashes simply stopped occuring. Indeed most of them
where due to freeing in a lib memory which had been allocated in another.

The nice thing with Qt is that everything really needed was provided with Qt
itself in its 3rdparties: libjpeg, libpng, sqlite... If ICU is a "hard" need,
then IMHO it's a good candidate to be provided alongside the other 3rdparties.

Regards,

-- 
      /- Yves Bailly - Software developper  -\
      \- Sescoi R&D  - http://www.sescoi.fr -/
"The possible is done. The impossible is being done. For miracles,
thanks to allow a little delay."



More information about the Development mailing list