S-Function Builder -- compile all c-files in folder
3 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I'm using the S-Function Builder block to include custom c-code in a Simulink model. Everything works fine except that I cannot compile all .c-files in a directory without adding them one by one explicitly to the source file list in the "Libraries" pane.
Working Solution:
./TL_s-function/file1.c
./TL_s-function/file1.c
./TL_s-function/file1.c
...
INC_PATH ./TL_s-function/
INC_PATH ./TL_s-function/include/
INC_PATH ./TL_s-function/Parameter/
Desired Solution:
SRC_PATH ./TL_s-function/
INC_PATH ./TL_s-function/
INC_PATH ./TL_s-function/include/
INC_PATH ./TL_s-function/Parameter/
This solution leads to an "error LNK2019: unresolved external symbol" error due to the uncompiled c-files. I thought "SRC_PATH" instructs the mex compiler to compile all c-files in this directory. But it doesn't. Is there any other solution? Thanks.
(I'm using Version 8.1 (R2013.a) on a Windows machine with "Microsoft Software Development Kit (SDK) 7.1" compiler )
0 件のコメント
回答 (2 件)
Huihua Zhao
2018 年 6 月 11 日
I came to a similar problem. It seems that you have to add the directory to "SFCN_DIR" instead. This trick fixes my problem.
0 件のコメント
Alexander Tuma
2024 年 2 月 26 日
As I understand it, adding a directory with SRC_PATH includes this directory into the search for source files. Therefore the source files can be added without preceding path.
So you can add your source files as if they were in your working directory, but you still have to add all of them.
SRC_PATH ./TL_s-function
file1.c
file2.c
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!