Boost logo

Threads-Devel :

Subject: Re: [Threads-devel] thread_specific_ptr within DLL cause a "is not a valid Win32 application" error during loading of the dll
From: Rudi Lindl (rudi.lindl_at_[hidden])
Date: 2008-09-04 04:58:10


I think i have found the problem,

the dll i used included the Managed Extensions for C++ projects. This cause
the problem because Managed Extensions for C++ projects that are created as
DLLs by default do not link to native C/C++ libraries such as the C run-time
(CRT) library, ATL, or MFC and do not use any static variables (see
http://support.microsoft.com/?scid=kb%3Ben-us%3B814472&x=5&y=4). The
testind DLL i wrote did not uses the managed extensions and therefore had no
problems.

Maybe you should mention this pitfall in the boost thread documentation.

Regards
Rudi

2008/9/3 Rudi Lindl <rudi.lindl_at_[hidden]>

> I use Boost Version 1.36.
> Unfortunately the code is not easy to cut out, because of many
> dependencies. I will try to cut of all unneeded parts but this will take
> some time.
>
> Regards,
> Rudi
>
> 2008/9/3 Rudi Lindl <rudi.lindl_at_[hidden]>
>
> I use Boost Version 1.36.
>> Unfortunately the code is not easy to cut out, because of many
>> dependencies. I will try to cut of all unneeded parts but this will take
>> some time.
>>
>> Regards,
>> Rudi
>>
>>
>>
>> 2008/9/3 Anthony Williams <anthony_at_[hidden]>
>>
>> At Wed 03 Sep 2008 10:47:33 BST, Rudi Lindl <rudi.lindl_at_[hidden]> wrote:
>>>
>>> Unfortunately i get an error during the loading of the dll when i define
>>>> a
>>>> boost::thread_specific_ptr within the dll. The dll compiles fines. If i
>>>> want
>>>> to use the dll with the LoadLibrary command i get Error 193 "is not a
>>>> valid
>>>> Win32 application".
>>>>
>>>
>>> The result is that everything works fine
>>>> (including boost::thread_specific_ptr ) untill i instantiate cetain
>>>> objects.
>>>>
>>>
>>> Firstly, which version of Boost are you using, and with which compiler?
>>>
>>> Secondly, there is clearly a bad interaction between these objects and
>>> boost::thread_specific_ptr. Please could you post some code that
>>> demonstrates the problem, so we can figure it out.
>>>
>>> Anthony
>>> --
>>> Anthony Williams | Just Software Solutions Ltd
>>> Custom Software Development | http://www.justsoftwaresolutions.co.uk
>>> Registered in England, Company Number 5478976.
>>> Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL
>>>
>>>
>>> _______________________________________________
>>> threads-devel mailing list
>>> threads-devel_at_[hidden]
>>> http://lists.boost.org/mailman/listinfo.cgi/threads-devel
>>>
>>
>>
>



Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk