I found out why. I was using the libary in debug mode when it is a release library. When I compiled it in release mode it worked fine.

Is there a debug library anywhere?