How to provide absolute path of include directories in code generation?

42 visualizaciones (últimos 30 días)
I want to include some files which is not in the current working directory. Is it possible to provide absolute path in include directory in Custom Code in Code Generation pane. Please mention the syntax to provide the absolute path.

Respuesta aceptada

Jason Moore
Jason Moore el 6 de Feb. de 2015
It is possible to include files using a relative or absolute paths. The syntax for relative paths is shown in the following link Relative Custom Code Include Path
To include a absolute path for include files with embedded coder you can simply goto Configuration Parameters -> Code Generation -> Custom Code -> Include Directories and then type in your folder paths i.e. C:\My_Folder\
  3 comentarios
Jason Moore
Jason Moore el 9 de Feb. de 2015
Can you include a list of items in your Custom Code pane and the error that is thrown during linking?
Phil Taylor
Phil Taylor el 23 de Feb. de 2016
I've got the exact same problem using Include Directories in Embedded Coder. There appears to be a bug where the relative folder gets added to the current folder instead of the relative adjustment occurring. For example, I get combinations of errors like this:
Working Directory
"C:\somedir\codegendir"
Source File
included.c
Include directory of source file (relative)
..\..\includedir
Error (this is paraphrased from various errors)
The following error occurred while tokenizing the custom code parameters:
'included.c specified in custom source files string does not exist in any
of the following search directories:
"..\..\..\includedir"
"C:\somedir\codegendir"
"C:\somedir\codegendir\..\..\includedir"
What it should do is find this folder relative to codegendir:
"C:\includedir"

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Deployment, Integration, and Supported Hardware en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by