BTW, I choose the RTI Connext 6.x Project as the toolchain. I also try that if the entire program is compiled using other toolchains without adding the DDS blockchain, there will be no errors. But I need to use the dds blockset so I cannot use the normal toolchain.
Why simulink embedded coder can generate code but compilation error?
5 次查看(过去 30 天)
显示 更早的评论
When using the ebedded coder to generate code, only the code is generated without any errors, but when compiling, an error is reported. Simulink cannot display the specific error location. Can I adjust the settings to see which step went wrong?
I ran the generated cmakelist file separately, I'm not sure if there was an error running on cmakelist.txt, it needs to include a .cmake file, but it doesn't seem to have been generated at all.
2 个评论
回答(1 个)
Shubham
2024-9-9
Hi 昱颖 陈,
It seems the error you are facing is due to non-ASCII characters in your file paths, which can cause issues with character encoding during the build process. This often results in garbled text (?????) in logs when the compiler or build tools can't recognize certain characters.
You may be encountering this error due to following reasons:
- The build process is unable to use the MinGW compiler because the build folder path contains characters that do not belong to the system locale.
- The toolchain option may not support the current file path characters.
- The “GenerateMakefile” setting might need to be adjusted to handle unsupported characters.
You can try the following workarounds to resolve the issue:
- Move your Simulink model and generated code directories to a location with only ASCII characters, like "C:\Simulink_Work\Project", avoiding spaces or special characters.
- Change the toolchain option or set "Generate makefile" to "off" from "Code Generation" settings in the model configuration to handle unsupported characters by the MinGW compiler.
- Ensure your system locale supports UTF-8. On Windows, go to "Control Panel" > "Region" > "Administrative" tab. Click on "Change system locale..." and select a locale that supports UTF-8 (e.g., "English (United States)"). Make sure to check the box for "Beta: Use Unicode UTF-8 for worldwide language support". In Unix, use the "locale" command to check and set the locale.
Refer to the following documentation link for more information on "generateMakefile":
Hope this helps.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!