Implementing "import" for share libs #42
ASDAlexander77
started this conversation in
Ideas
Replies: 4 comments
|
but for now it is possible to load functions from shared lib manually. One of the examples: function LLVMLoadLibraryPermanently(filename: string): TypeOf<1>;
function LLVMSearchForAddressOfSymbol(symbolName: string): Opaque;
function LoadFunction(dllName: string, funcName: string)
{
LLVMLoadLibraryPermanently(dllName);
return LLVMSearchForAddressOfSymbol(funcName);
}
let test1: () => void = LoadFunction("./1.dll", "test1");
function main()
{
test1();
}It is importent to link |
0 replies
|
or to use internal commands the above code can be reduced to function LoadFunction(dllName: string, funcName: string)
{
LoadLibraryPermanently(dllName);
return SearchForAddressOfSymbol(funcName);
}
let test1: () => void = LoadFunction("./1.dll", "test1");
function main()
{
test1();
} |
0 replies
|
Shared library should have file with "export" function and without Example: export function test1()
{
print("Hello World!");
} |
0 replies
first example is ready |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Thinking about implement support for shared libs.
All reactions