mcc and startup

2 visualizaciones (últimos 30 días)
Mateusz
Mateusz el 19 de Ag. de 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?

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 19 de Ag. de 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.

Categorías

Más información sobre C Shared Library Integration en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by