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

43 ビュー (過去 30 日間)
Rani V.S
Rani V.S 2015 年 2 月 6 日
コメント済み: Phil Taylor 2016 年 2 月 23 日
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 件)

カテゴリ

Help Center および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by