"Invalid file identifier" error while code generation
8 views (last 30 days)
Show older comments
I am using MATLAB 2019b and trying to generate a .dll file from a simulink model to integrate with Vector CANoe.
I also setted Microsoft Visual C++ 2019 as a c++ compiler.
I have chosen 'cn.tlc' in the code generation panel.
But when I am trying to generate code I am getting:
The call to cn_make_rtw_hook, during the after_tlc hook generated the following error: Invalid file identifier. Use fopen to generate a valid file identifier.
3 Comments
Anna Papasheva
on 9 Oct 2020
Hi,
I was trying to compile C++ but it is right to use C. I was able to do it successfully till today, but now I can not generate dll again. I don't have any errors but no dll either.
Answers (1)
Dhruv
on 2 Jun 2025
Hi,
I see you're running into the "Invalid file identifier" error when trying to build a model using the cn.tlc system target file. From what I've seen, this error often happens when the target file is set using a relative path. A good workaround is to try using the full absolute path to the cn.tlc file instead.
Additionally, CANoe is a tool developed by Vector. For more in-depth help with this or other CANoe-related issues, I'd recommend reaching out to Vector's technical support here:
I hope this helps!
0 Comments
See Also
Categories
Find more on Simulink Coder in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!