SFML community forums

Help => General => Topic started by: pabloist on July 17, 2010, 09:05:38 am

Title: Errors running my first program
Post by: pabloist on July 17, 2010, 09:05:38 am
So I'm following the Code::Blocks installation of SFML.

The program compiles, but then when I run it, it tells me that sfml-system-d.dll is missing from my computer. However, I can see it right there in my SFML\lib folder. Any ideas on what's going on?

I've tried both sticking the lib and header files in the Code::Blocks program file directory and using the Settings - Compiler and Debugger - Search directories - Compiler/Linker to give the location of the files.
Title: Errors running my first program
Post by: Laurent on July 17, 2010, 09:40:30 am
The DLLs must be in the same directory as your executable.
Title: Errors running my first program
Post by: pabloist on July 17, 2010, 04:35:02 pm
So ...

Quote
Leave the SFML files where you want, and setup Code::Blocks so that it can find them

    * Go to the Settings / Compiler and debugger menu, then to Global compiler settings / Search directories
    * In Compiler, add SFML-x.y\include
    * In Linker, add SFML-x.y\lib\mingw



doing this doesn't work?[/quote]
Title: Errors running my first program
Post by: dunce on July 17, 2010, 05:10:17 pm
Doing this works while you are building a program. For the executable to be able to run you have to place all dependency .dlls in the same folder as the .exe file, as Laurent wrote.
Title: Errors running my first program
Post by: pabloist on July 17, 2010, 05:25:03 pm
Okay, I copied all the .dlls from the lib folder. Now, it's telling me that it can't start because libgcc_s_dw2-1.dll is missing...what?
Title: Errors running my first program
Post by: ActionBoy on July 17, 2010, 09:18:47 pm
I think this might help:

http://www.sfml-dev.org/forum/viewtopic.php?t=2812&highlight=libgccsdw21+dll
Title: Errors running my first program
Post by: pabloist on July 18, 2010, 06:11:10 am
Ok, thanks. I did the same thing that guy did - downloaded the libgcc_s_dw2-1.dll.

So, every time I write an SFML program, I need to place the relevant  .dlls in the bin folder? (The one containing the .exe)
Title: Errors running my first program
Post by: Disch on July 18, 2010, 06:20:07 am
Or you could put them in any folder that your OS looks in for libraries.

On windows, this is typically your "System32" folder.  iirc, "C:\Windows\System32" or "C:\WINNT\System32".  If you put the DLL files there they'll work for any programs you make/download in the future.
Title: Errors running my first program
Post by: pabloist on July 18, 2010, 06:32:30 am
Okay, I'll try that. Thank you!
Title: Errors running my first program
Post by: Laurent on July 18, 2010, 04:34:19 pm
Or use the static-libgcc linker option.