amoeba
amoeba copied to clipboard
How do I create a DLL for this library?
I'd like to use amoeba as an external library in Smalltalk but don't know how to generate a DLL from the header file.
Is there a one line script for doing so with gcc or other C compiler?
Got it: gcc -shared -O2 -DAM_IMPLEMENTATION -xc ameoba.h -o ameoba.dll
The DLL loads fine, but the example fails with an invalid memory access error in am_setrelation(c1, AM_EQUAL)
. It seems to be happening inside the call to am_multiply
https://github.com/starwing/amoeba/blob/master/amoeba.h#L594 since it gets further if I change the relation to AM_GREATEQUAL
.
Are there any other flags that need to be set for 32-bit builds? I did try again with -DAM_USE_FLOAT
but that didn't seem to make a difference.
Which system your on? maybe I could try it out. It works well on my Mac.
I have tried the DLL build on Windows. Could you give me a segfaul example? the test.Lua seems work.
gcc -o amoeba.dll -mdll -DLUA_BUILD_AS_DLL .\lua_amoeba.c -LC:\Devel\Lua54\lib
-llua54