Using pre-compiled libraries in my VHDL files of a new project does not work correctly. This is very useful for code re-use across project.
Use XST property to set the location of the required library:
set -xsthdpini ".\hdl.ini"
This library is then referenced in the VHDL files as follows:
For the most recent architectures using the new XST parser, this fails with errors as follows:
"ERROR:HDLCompiler:104 - "main.vhd" Line 4: Cannot find <lib> in library <mylib>. Please ensure that the library was compiled, and that a library and a use clause are present in the VHDL file.
Parsing entity <main>.
ERROR:HDLCompiler:854 - "main.vhd" Line 7: Unit <main> ignored due to previous errors.
Parsing architecture <default> of entity <main>."
This is aknown limitation with the new parser.
To work around this issue, the library files must be included in the current project and compiled again.