Code Blocks probably sets the working directory to the project root ($(PROJECT_ROOT)), where the dll's are currently placed. When launching the program manually the working directory is $(PROJECT_ROOT)\bin\Debug. Try copying the executable to the $(PROJECT_ROOT) and see if that fixes it (so copy the .exe to the folder with the dll's in it).