问题
I am using GenTLB.exe to compile a ridl file to .tlb and _TLB.pas files.
In the resulting _TLB.pas file, there are hints that it has renamed a number of symbols by appending an underscore to the end of the name.
A sample of the hints is:
// Errors:
// Hint: Symbol 'Assign' renamed to 'Assign_'
// Hint: Enum Member '_amStretch' of 'EnumVRSAppliedMaterial' changed to '_amStretch_'
// Hint: Enum Member '_amTile' of 'EnumVRSAppliedMaterial' changed to '_amTile_'
The command line I use with GenTLB is:
GenTLB -P -Pt+ <ridl file>
I get the same problem occuring if I use the tlibimp tool as well.
回答1:
Assign is renamed to Assign_ because of a mapping in tlibimp.sym, a INI-format text file in the same directory as tlibimp
.
Another piece of logic continuously appends '_' until the name is unique with respect to prior global names tlibimp
has found. All enumeration members are interpreted as globals. Are there any other instances of _amTile etc. in the generated .pas file?
回答2:
I am not sure, but often an underscore is appended in front of a name, if the name is conflicting with and exsisting name (e.g. reserwed word, and so). It could be something like that.
来源:https://stackoverflow.com/questions/531171/why-is-gentlb-renaming-symbols-appending