mcc and startup

2 vues (au cours des 30 derniers jours)
Mateusz
Mateusz le 19 Août 2011
Hi,
In startup.m in my home directory I use addpath to include additional libraries. Now I would like to compile some source file in this way that mcc tries to read startup.m at the beginning and then it compiles the source together with included folders from startup.m.
For instance I want to compile file d.m that uses library Lib. Now I can do this using option -I, that is mcc -m d.m -I Lib. However, for some reason I would prefer to have file startup.m with addpath(Lib), and use only mcc -m d.m. Is it possible to do this?

Réponses (1)

Kaustubha Govind
Kaustubha Govind le 19 Août 2011
The MATLAB path (that you add to using addpath) is only used to resolve MATLAB/Simulink related files (like .m, .p, .mat, mexw32, .mdl, etc). MCC does resolve any functions (or other MATLAB files) called from your application using the path. However, I don't believe library/object files can be resolved in the same way. This is because mcc hands off compilation of the generated C/C++ files to whatever compiler you choose using "mbuild -setup". So it isn't really MATLAB that is trying to resolve the symbols, but your linker.

Catégories

En savoir plus sur C Shared Library Integration dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by