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

Problems calling an external C function

Problems calling an external C function

Hello everyone,

I am trying to call an external C function from my Modelica code Under Windows 8, with OpenModelica1.12.0-64bit.
From what I understood, under OpenModelica, it should be possible to call external C functions by at least 3 different manners:

1) By letting OpenModelica compiler do the work : by directly calling the .c file (as described in here, part "Letting the Modelica compiler do the work")

Click on [Image 1] for more infos on what I did.

2) By separate compilation : By calling the .o file, obtained from the MinGW gcc compilation of the .c file (as described with the ExternalFunc1 calling in

Click on [Image 2] for more infos on what I did.

3) By separate compilation :  By calling the .a and .o files obtained from the MinGW (as described with the ExternalFunc2 calling in here)

Click on [Image 3] for more infos on what I did.

I tried to implement all of the cases, inspiring me from the links cited previously. None of these implementations worked and I don't know what I did wrong.

So I would like to know if someone could help me calling external C functions, I would be very grateful. Obviously, if necessary, I can give you more informations about what I did (how I installed MinGW...). Also, I would like to know if it is possible (if yes, how) to call external C functions from .dll and .lib files.

By advance, thank you,

William

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