Why can the Open function not be used in compiled applications?

5 visualizaciones (últimos 30 días)
Anna
Anna el 5 de En. de 2018
Comentada: M. A. Hopcroft el 29 de Abr. de 2019
Hi, I am building a standalone application that should be compiled for PC, MAC and Linux. As I have a pdf with instructions and release notes, I planned to use open('ReleaseNotes.pdf'). However, after successfully compiling , I get the following warning in the command shell (running in Windows, I haven't tested the other two yet):
Warning: The Open function cannot be used in compiled applications.
1. Does somebody knows why this is happening? The funtcion open is not on the list of excluded functions ( https://de.mathworks.com/help/compiler/unsupported-functions.html ) and also not in mccExcludedFiles.log.
2. If there is no single function I can use for all three environments, is there something similar to winopen, which works in Windows, for Mac and Linux?
Thanks, Anna

Respuestas (1)

Jan
Jan el 4 de Jul. de 2018
Editada: Jan el 4 de Jul. de 2018
Look at the file:
edit(fullfile(matlabroot, 'toolbox\matlab\general\private\openpdf.m'))
This is the method to open PDFs under Windows, Linux and MacOS. I'm not sure why open does not work in a compiled application. But you can try to create a clone of this method and adjust it to your needs.
  1 comentario
M. A. Hopcroft
M. A. Hopcroft el 29 de Abr. de 2019
This answer helped me, thanks. I note that the inability to use "open" in compiled applications is a change from previous versions. It worked in R2015b, but fails in R2018b.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Compiler 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