How to provide absolute path of include directories in code generation?
31 views (last 30 days)
Show older comments
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.
0 Comments
Accepted Answer
Jason Moore
on 6 Feb 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 Comments
Jason Moore
on 9 Feb 2015
Can you include a list of items in your Custom Code pane and the error that is thrown during linking?
Phil Taylor
on 23 Feb 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"
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!