If the compilers can't find the libraries, that means they either aren't in a standard search location or you aren't giving the right location to the linker.
You get it working in a terminal outside of the IDE, so that makes me think that Code::Blocks simply isn't searching for where they're located. Maybe you could try putting them in a standard search path? It's probably time I do some tutorials for common IDE's. I've opened up an issue on github so I don't forget.
"./main: error while loading shared libraries: libdsfml-graphics.so.2: cannot open shared object file: No such file or directory."
This is Linux saying that it doesn't know where to look for the shared libraries at run time. Try exporting the location of the libraries before running "./main"
Judging from what you posted already, this should work.
export LD_LIBRARY_PATH=/SFML/DSFML-nightly && ./main
Lastly, I don't use gdc so I can't really say much about it. If you wouldn't mind giving me your full command line that you used outside the IDE, I will look into that more and get back to you.