Simulink real time desktop : I get the following error gmake: *** [coder_posix_time.o] Error 1, when trying to build "Run in real time" in "run in kernel"

8 ビュー (過去 30 日間)
ian alers
ian alers 2024 年 2 月 21 日
編集済み: Francesco 2024 年 10 月 18 日
These are the errors I get when compiling a Simulink program in Desktop Real Time, using "Run in Real Time" and "Run in Kernel" options:
C:/PROGRA~1/MATLAB/R2022b/toolbox/eml/externalDependency/timefun/coder_posix_time.c:94:14: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration] status = clock_gettime(CLOCK_MONOTONIC, &tspec); ^ C:/PROGRA~1/MATLAB/R2022b/toolbox/eml/externalDependency/timefun/coder_posix_time.c:94:28: error: use of undeclared identifier 'CLOCK_MONOTONIC' status = clock_gettime(CLOCK_MONOTONIC, &tspec); ^ C:/PROGRA~1/MATLAB/R2022b/toolbox/eml/externalDependency/timefun/coder_posix_time.c:147:14: warning: implicit declaration of function 'clock_gettime' is invalid in C99 [-Wimplicit-function-declaration] status = clock_gettime(CLOCK_REALTIME, &ts); ^ C:/PROGRA~1/MATLAB/R2022b/toolbox/eml/externalDependency/timefun/coder_posix_time.c:147:28: error: use of undeclared identifier 'CLOCK_REALTIME' status = clock_gettime(CLOCK_REALTIME, &ts);
Any help in resolving this error would be appreciated.
  1 件のコメント
Francesco
Francesco 2024 年 10 月 18 日
編集済み: Francesco 2024 年 10 月 18 日
I have the same error, generated by tic toc function and toolchain gnu tools for ARM Embedded Processor. Removing tic/toc the error disappears.

サインインしてコメントする。

回答 (1 件)

R
R 2024 年 3 月 21 日
Hey,
I encountered a similar issue while trying to calculate simulation time. I found that the function "clock_gettime" is not suitable for my workflow, and therefore, I used the Clock block instead.
Hopefully, this helps you in resolving the error too!

カテゴリ

Help Center および File ExchangeRaspberry Pi Hardware についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by