Replies: 1 comment
-
|
A little example on how to reproduce the issue with minimal code (the mentionned /h/cpp files are inside the attach zip). // Step 1 // Step 2 // Step 3 // Step 4 // Step 5
// Step 6 // Step 7 // Step 8
// Step 9
// Step 10
// Step 11
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello !
I'm trying to integrate Luau in my personal project. I have a thirdparty project for it in VS that build Luau as a static library (was not able to build it as a dynamic library btw, seems corrupted each time, even from the cmake example), the same thing as the cmake command. Then I have an other project that reference it and build a dynamic library. Finally I have an application project that reference the dynamic library.
If I'm using luaL_newstate/lua_close directly inside the application project no problem. But if I'm using an helper class that encapsulate these call inside some function defined in a cpp an exposed with __declspec I'm crashing when lua_close is called.
Crashing in lmem.cpp on
LUAU_ASSERT(page && page->busyBlocks > 0);page is nullptr.
If I move the code that use luaL_newstate/lua_close from the cpp to the h (no export needed) I'm not crashing anymore and everything is fine. I'm trying to fine if a compilation/linker flag set in my project is not compatible with the way Luau is build but I didn't find one yet.
Is there some restriction for referencing luau from a dynamic library ? Or maybe I missed something obvious in the documentation ?
Any help is appreciated.
Thx for your time.
Beta Was this translation helpful? Give feedback.
All reactions