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!