- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Compiling the generated .CPP file
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.
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Compiling the generated .CPP file