AIMMS Knowledge Base Article – KB000044
Error: The identifier … has not been declared
The information in this article applies to:
- AIMMS 3.9
The namespace structuring of units has changed. From AIMMS 3.9 onwards the same namespace structuring is used as for identifiers. In previous AIMMS versions units had a singleton namespace and were therefore always known globally.
When opening an existing AIMMS project in AIMMS 3.9 you run into the error “Error: The identifier … has not been declared.”
Your model has quantities with units declared locally (e.g. within a library or module) while the units are also used outside the declared scope. In AIMMS 3.9, these units are no longer known outside the declared scope due to the introduction of the namespace structuring for units.
There are different possible resolutions:
- Place all quantity and unit declarations that are used globally in the main model.
- Prefix the references to units in your model, where necessary.
- Switch the backward compatibility option ‘Singleton Unit Namespace’ to ‘On’. Switching this option ‘On’ will result in the old behavior. Be aware that this can also result in some unwanted side effects during future developments, for example two different libraries containing declarations of the same unit will result in a name clash.
See the help of option ‘Singleton Unit Namespace’ and the AIMMS Language Reference section 29.2 “Quantity declaration”, paragraph “Separate namespace” for more information.