Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

How to include a dll in Dymola?

How to include a dll in Dymola?

Hello everybody,

I managed to use an external function from a .lib file using:

annotation(Include="#include <add2.h>", Library="ext");

But I currently have the actual functions stored in a dll. Can I include the dll somehow?

Thanks!

Cristian Stefan

Re: How to include a dll in Dymola?

Hello Cristian

As far as I know you cannot load directly a DLL into OpenModelica. However you can easily create a lib with some C functions using LoadLibrary() and GetProcAddress() to load the DLL and calling the DLL functions.

If you need more details we will be glad to answer you.

Best regards
Koldo

Re: How to include a dll in Dymola?

Hello Cristian,

look for loading of dll's at Dymola User Manual Volume 2.pdf on side 333.

Best Regards
Gora

Re: How to include a dll in Dymola?

Hello,

@Koldo: I don't know what you mean by creating a lib using LoadLibrary(). Can you expand on that? Thanks!

@Gora: I already tried that , but it only shows you how to call functions from a .lib library and not a .dll . The only thing they say about using dll's is that you can use a wrapper function which I don't know exactly how it works.

Best regards,

Cristian

There are 0 guests and 0 other users also viewing this topic
You are here: