Potential conflicting usages of identifier '(Library_file_name).h'
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
I get the below error while i try to Build code for CarMaker.tlc and I am using a same library file for different reference models
Potential conflicting usages of identifier 'Library_file_name.h': the name of the file for the block 'Library_block_name1FCT', and the name of the file for the block 'Library_block_name2FCT'
The code is built successfully for individual child reference models, but if I build code for parent model i get this error.
Configurations are as below:
Code interface packing : Reusable function
Multi-instance code error diagnosis: Warning
Library block settings:
Block Parameters --> Code Generation:
Function packaging: Reusable function
Function name option: Auto
File name option: Auto
Could you please help me on this?
0 Commenti
Risposte (1)
Sreeram
il 9 Giu 2025
Hi Lakshmi,
The error "Potential conflicting usages of identifier 'Library_file_name.h'" typically occurs when a reusable library block is used in multiple referenced models, and the generated code assigns the same identifier (such as a file name) to different instances. While individual reference models may build successfully, building the parent model brings all instances together, leading to identifier conflicts.
In this case, the library block is configured as a Reusable function, with both Function name and File name options set to Auto. This configuration generally allows Simulink to append a checksum to ensure unique naming across instances. However, as noted in this discussion, certain combinations of settings can prevent the checksum from being appended, leading to name clashes.
To resolve this, ensure that name mangling is allowed—this requires using "Auto" or "Default" storage classes, as described in this resource. Another approach is to manually assign unique identifiers using the Code Mappings Editor or to rename the conflicting blocks directly in the model. In some cases, reviewing how the reusable library block is instantiated across the hierarchy may help avoid such conflicts.
For more details and guidance on this, refer to the following staff-authored MATLAB Answers posts:
0 Commenti
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!