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

30 次查看(过去 30 天)
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.

采纳的回答

Jason Moore
Jason Moore 2015-2-6
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 个评论
Jason Moore
Jason Moore 2015-2-9
Can you include a list of items in your Custom Code pane and the error that is thrown during linking?
Phil Taylor
Phil Taylor 2016-2-23
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"

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by