Often when you run a program inside an IDE it sets a specific 'working directory' where it looks for your DLLs. This may not be the same directory as where your executable is located.
To fix this, you usually need to do the following:
- Ensure the exe is being output in the place you want (usually under the project's output or linker settings)
- Move all DLLs to that place (do this yourself, via Explorer etc)
- Ensure the IDE runs the exe from that location (usually under the project's debug settings)
This allows it to work the same way whether run from the IDE or not.