Just wanted to mention that I had strange problems with Analysis&Synthesis of a project with a generated Qsys component, and I believe my problems could be attributed to the library handling as well.
For a Qsys custom component, I had stuff defined in a package (which is often necessary, with no workaround) and accessing packages need explicit library specification (use work.mypackage; etc). This usually works fine (for some reason, Quartus still finds the package althogh the generated Qsys system will place all units in a specific Qsys library), but I had one persistent error were something went wrong. It turned out that Analysis&Synthesis was unable to call a function in the custom package (the function was used to provide the actual for a generic).
I finally could work-around this by declaring a constant in the package, initializing the constant with the function (in the same pakcage), and provide the actual from that constant. In this way Analysis&Synthesis called the package function during package elaboration, not when elaborating the entity that needed the value.
My suspicion that this was a VHDL library issue is strengthen by the fact that instantiating the component directly in the Quartus project, rather than have it generated by Qsys, worked fine.