How can I create C library ('.lib' file) from my model in Real-Time Workshop 6.6 (R2007a)?

1 view (last 30 days)
I would like to be able to create C library ('.lib' file) from my model. Using 'ert_shrlib.tlc' target, it is possible to create shared library (.dll files). I would like to know if it is possible to generate a '.lib' file too.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 15 May 2010
While using the shared library target 'ert_shrlib.tlc', by default '.lib' files are not created. However, you can change the default behavior and retain the '.lib' file by modifying the corresponding template makefile (TMF). For example in the template make file 'ert_vc.tmf' line 347 mentions that:
"#--- Comment out the next line to retain .lib and .exp files ---"
If you comment out the next line in this file, '.lib' and '.exp' files are retained. However, please note that if you do this, the generated 'model.h' file will need a small modification to be used together with the generated 'ert_main.c' for implicit linking. For example, if you are using the Microsoft Visual C++ development system, you will need to declare' __declspec(dllimport)' in front of all data to be imported implicitly from the shared library file.
This is also mentioned in the document. Please run the following command in MATLAB to see the documentation for this:
web([docroot,'/toolbox/ecoder/ug/bq2nslk-1.html#bq2nufb-1'])

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products


Release

R2007a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!