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

Compiling the generated .CPP file

Compiling the generated .CPP file

Hello,
As we know after compiling Modelica model we get some files including $ModelName$.cpp

I am going to use this C++ code separately in a program. Preferably I want to make a dll file with it and use the dll file in my applications. How I can do this?
For example is it possible to compile the code with C++ compiler. How I should include the header files? After all is it possible to get the final results by using the  generated dll file?

Thanks a lot

Re: Compiling the generated .CPP file

It is somewhat possible. You need to link in the simulation runtime though; it includes a main() function, but I do believe it is possible to write your own entry function.
The script Compile.bat sets all environment variables you need and calls make.exe on the $ModelName$.makefile. It is possible to set this in your program and call g++ with dynamic linking options.

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