Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Errors running my first program  (Read 5132 times)

0 Members and 1 Guest are viewing this topic.

pabloist

  • Newbie
  • *
  • Posts: 26
    • View Profile
Errors running my first program
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Errors running my first program
« Reply #1 on: July 17, 2010, 09:40:30 am »
The DLLs must be in the same directory as your executable.
Laurent Gomila - SFML developer

pabloist

  • Newbie
  • *
  • Posts: 26
    • View Profile
Errors running my first program
« Reply #2 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]

dunce

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
Errors running my first program
« Reply #3 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.

pabloist

  • Newbie
  • *
  • Posts: 26
    • View Profile
Errors running my first program
« Reply #4 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?

ActionBoy

  • Newbie
  • *
  • Posts: 36
    • View Profile
Errors running my first program
« Reply #5 on: July 17, 2010, 09:18:47 pm »

pabloist

  • Newbie
  • *
  • Posts: 26
    • View Profile
Errors running my first program
« Reply #6 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)

Disch

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Errors running my first program
« Reply #7 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.

pabloist

  • Newbie
  • *
  • Posts: 26
    • View Profile
Errors running my first program
« Reply #8 on: July 18, 2010, 06:32:30 am »
Okay, I'll try that. Thank you!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Errors running my first program
« Reply #9 on: July 18, 2010, 04:34:19 pm »
Or use the static-libgcc linker option.
Laurent Gomila - SFML developer