If a compilation causes such an error and works correctly in SQL*Plus, then I suspect a problem with the "debug information" mode. To verify this, go to Tools > Preferences > Debugger tab page, disable the "Add debug information when compiling" option, and retry the compilation.
If you are using PL/SQL Developer 6.0 or later, you can explicitly exclude specific objects from debug information. On the same debugger tab page you can add a line with the name (or owner.name) of the program unit to the "NEVER add debug info for objects" list.