I ahave seen the error while trying to perform other actions in QTP. When I experience this, I have always needed to restart the QTP app in order to get it working correctly again. QTP may even have had to forcibly end-tasked.
I have done both of the things recommended by "Jonty" and I have not seen the problem since (to the best of my recollection), so I'd second that advice.
I will also add that I have found QTP 9.2 to be more stable in this regard than 9.0, especially since uninstalling / re-installing.
[ QUOTE ]
Workaround for this would be use "ExecuteFile" statement in the begining of your script to add and compile function library.
[/ QUOTE ]
I am not sure I would do any workaround to this problem. Inability to add libs to the Test->Resources tab either indicates that you have a very broken QTP installation, or that you have some configuration/setup issue that has not yet been uncovered with this thread.
If you have not un-installed and then re-installed QTP (which I know is a pain in the butt), I would surely try this next.
P.S. You indicate you are using QTP "9.0". If you really have version 9.0 make sure you uplevel to 9.2 before reinstalling.