Run the application in the IDE again, and have a look at the loaded modules view.
Find there which libstdc++-6.dll is used.
Then make sure your application loads the same libstdc++-6.dll when running out side of the IDE, it could be you have two libstdc++-6.dll libs, one version build with MinGW and the other by MSVC.
Bookmarks