I’m trying to do the same with CodeIgniter. I want an auth system that works for both WP and the custom system I’m designing. I’m getting the same error that you are. I came here for help, but it doesn’t appear anyone has found a resolution yet.
There’s quite a few threads with this same issue, such as here, here, here, and here. If anyone has found a solution, please post it.