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

Author Topic: SFML integration with Code::blocks  (Read 3029 times)

0 Members and 1 Guest are viewing this topic.

HelpMe

  • Newbie
  • *
  • Posts: 5
    • View Profile
SFML integration with Code::blocks
« on: April 01, 2011, 03:53:09 pm »
Guys please help me because I am either very dumb or super dumb.
I can't integrate SFML w/ Code::blocks. I download Code::blocks without the MinGW. Then i follow the link and download mingw-with-gcc-4.4.zip as recommended. Then i enter the sample code compile and it runs nicely. But when i go the the project folder and try to run the binary file as a standalone application i get this error: This application has failed to start because libgcc_s_dw2-1.dll was not found. Re-installing the application may fix the problem.

How do i fix that  :!:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML integration with Code::blocks
« Reply #1 on: April 01, 2011, 03:55:56 pm »
The DLL is located in mingw\bin. Copy it next to yuor executable, or add its path to the PATH environment variable.
Laurent Gomila - SFML developer

HelpMe

  • Newbie
  • *
  • Posts: 5
    • View Profile
SFML integration with Code::blocks
« Reply #2 on: April 01, 2011, 05:52:18 pm »
OK that worked nicely , but do i have to copy that .dll file to every executable i make with SFML?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML integration with Code::blocks
« Reply #3 on: April 01, 2011, 06:06:06 pm »
You can use the "-static-libgcc" linker flag to get rid of this DLL.
Laurent Gomila - SFML developer

HelpMe

  • Newbie
  • *
  • Posts: 5
    • View Profile
SFML integration with Code::blocks
« Reply #4 on: April 01, 2011, 09:02:26 pm »
Laurent i appreciate all your timely and concise replies but could you please tell me how exactly i use that "-static-libgcc" linker flag.

Big thank you.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML integration with Code::blocks
« Reply #5 on: April 01, 2011, 09:11:19 pm »
Laurent Gomila - SFML developer

HelpMe

  • Newbie
  • *
  • Posts: 5
    • View Profile
SFML integration with Code::blocks
« Reply #6 on: April 02, 2011, 11:07:45 am »
Laurent that really worked, I can't express my gratitude. Now I feel I can begin exploring SFML.
 
I have 2 questions however.

1) I find my self continuously going to Project -> Build Options... -> Linker Settings -> Other linker options and type:

-lsfml-graphics-s
-lsfml-window-s
-lsfml-system-s
-static-libgcc

When i quit the project, exit Code::blocks or just open a new project i have to go to Project -> Build Options... again and type the same linker libraries (they don't stay).

Is there a way to keep the libraries there for every project i make.

2) I noticed that whenever i execute an SFML .exe file that has its own window a command line window opens up as well ( both for debug and release versions).

Is it possible to get rid of the command line window?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SFML integration with Code::blocks
« Reply #7 on: April 02, 2011, 02:55:01 pm »
Quote
Is there a way to keep the libraries there for every project i make.

This is really a project-specific thing, globally linking all your projects to SFML would make no sense.

Quote
Is it possible to get rid of the command line window?

Create a GUI/Win32 (whatever it is on Code::Blocks) project instead of a console project.
Laurent Gomila - SFML developer

Svenstaro

  • Full Member
  • ***
  • Posts: 222
    • View Profile
SFML integration with Code::blocks
« Reply #8 on: April 02, 2011, 03:02:49 pm »
1) You need to specifically save the project. EDIT: Didn't read properly. You can use the Code::Blocks SFML preset to do that.

2) -mwindows to linker flags.

HelpMe

  • Newbie
  • *
  • Posts: 5
    • View Profile
SFML integration with Code::blocks
« Reply #9 on: April 02, 2011, 07:52:45 pm »
Well, I guess that's all I had to ask and I'm pleased I got my questions answered in a quick, concise and professional manner.

Big thank you to you Laurent and Svenstaro.
Laurent you are a genius. Keep up the good work.