Re: Static lib and lua5.1.dll (crash on lua_close_())

Mark Mruss <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
Hi Nigel,

Thanks for that catch. I will have to give this a try when I get home
tonight. Hopefully that is the problem. I will respond with my
results.

Thanks again everyone.

mark.

On Tue, May 18, 2010 at 7:03 PM, Nigel Atkinson <[email protected]> wrote:
> I'm not sure exactly what bjam uses, however I can see one difference in
> the way you have compiled your dll and the Lua dll.
>
> /MT and /MTd are different, both pull in a multi-threaded CRT dll,
> however /MTd pulls in the debug version.  So what happens is you have
> two separate runtimes being used, and nasty things happen when for
> example, memory is allocated in one, and free'd in the other etc.
>
> Whatever bjam does will have to be the same too.
>
> Hope that's the bug found! :-)
>
> Nigel
>
> On Tue, 2010-05-18 at 11:57 -0500, Mark Mruss wrote:
>> Nigel:
>>
>> This is the commandline that I used when compiling the lua DLL:
>>
>> /Od /I "../include" /D "_CRT_SECURE_NO_DEPRECATE" /D "DEBUG" /D
>> "MSVC9" /D "_WINDLL" /D "_MBCS" /Gm /EHsc /RTC1 /MT /Gy
>> /Fo"../obj/lua5.1_dll/Debug\\" /Fd"../obj/lua5.1_dll/Debug\vc90.pdb"
>> /W3 /nologo /c /Wp64 /ZI /TP /errorReport:prompt
>>
>> This is the bjam command that I use to compile luabind:
>>
>>
>> "C:\Program Files\boost\boost_1_42\bin\bjam.exe" -d+02
>> toolset=msvc-9.0 runtime-link=static link=static threading=multi
>> --debug-build define=LUA_BUILD_AS_DLL define=_MBCS
>>
>> And funally this is what I use to compile my dll:
>>
>> /Od /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "_USRDLL" /D "_WINDLL" /D
>> "_MBCS" /Gm /EHsc /RTC1 /MTd /Yu"stdafx.h" /Fp"Debug\CVSList.pch"
>> /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP
>> /errorReport:prompt
>>
>> Maybe I'm missing something but I think things are compatible?
>>
>> Kristoffer:
>>
>> Should I set _SECURE_SCL=1 or just leave it as the default for now?
>> I'm not using iterators in my code, but maybe it's something for
>> laubind.
>>
>> Thanks for the answers everyone, hopefully I'll be able to get it
>> working. Sorry if I'm missing something obvious.
>>
>> mark.
>>

------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.