gpt4 book ai didi

c - 解决 matlab 函数 : expected '=' , ',' 、 ';' 、 'asm' 或 '__attribute__' 之前 '.' token 中 Simulink C 代码的编译错误

转载 作者:行者123 更新时间:2023-11-30 19:26:06 24 4
gpt4 key购买 nike

继续关注 https://de.mathworks.com/help/simulink/ug/incorporate-c-code-using-a-matlab-function-block.html 上的 Matlab/Simulink 教程

基本的 C 代码应放入 matlab 功能 block 中。编译 Simulink 模型会导致以下错误消息:

C:\Users...\Matlab\slprj_slcc\6BPyb7AdG47rnTRBAilVFG\customcode_6BPyb7AdG47rnTRBAilVFG.c:4:9: error: expected '=', ',', ';', 'asm' or 'attribute' before '.' token doubleIt.c ^

我正在使用 MinGW 编译器和 Matlab/Simulink。有点困惑在哪里寻找错误修复,因为它似乎正是写下的教程。

知道如何修复它吗?

最佳答案

在 Simulink 的配置参数对话框中,在错误的输入寄存器处指定了头文件和源文件(由于反复试验)。头文件被错误地插入到“Insert custom C code in generated: Source File”位置。因此,Simulink 的 header 和源文件输入不正确。

关于c - 解决 matlab 函数 : expected '=' , ',' 、 ';' 、 'asm' 或 '__attribute__' 之前 '.' token 中 Simulink C 代码的编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57938786/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com