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

Author Topic: How to statically link sfml with codeblocks  (Read 2304 times)

0 Members and 1 Guest are viewing this topic.

InculetAlexandru

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
How to statically link sfml with codeblocks
« on: January 07, 2020, 02:35:33 am »
I followed all the steps from the website, including those with "sfml-graphics-s-d...." on debug and "sfml-graphics-s..." on release, but still when i click on the executable file of the project i still get the error mesage that the "sfml-graphics-2.dll is missing from your computer", but isnt that the purpose of the static linking to get rid of the dlls? ??? ??? ??? ???
 :o :o :o :o

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: How to statically link sfml with codeblocks
« Reply #1 on: January 07, 2020, 09:40:39 am »
Well, you did something wrong. :p

Did you recompile the project?
Did you define SFML_STATIC?

InculetAlexandru

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: How to statically link sfml with codeblocks
« Reply #2 on: January 07, 2020, 11:20:27 pm »
Well, you did something wrong. :p

Did you recompile the project?
Did you define SFML_STATIC?


I defined SFML_STATIC and everything still not working... :(

InculetAlexandru

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: How to statically link sfml with codeblocks
« Reply #3 on: January 07, 2020, 11:37:29 pm »
So, lets recap:
1. I downloaded the SJLJ version with Codeblocks
2. New Project -> Empty Project -> Project -> Build Options -> "Name of the project" -> Search directories -> Compiler -> Add -> Then I added the path to the include folder from the sfml file i have downloaded -> Said "No" to the "keep it as a relative path" question.
3."Name of the project" -> Search directories -> Linker -> Add -> Then I added the path to the lib folder from the sfml file i have downloaded-> Said "No" to the "keep it as a relative path" question.
4. Debug -> Linker settings-> Add -> Then I added "sfml-graphics-s-d","sfml-window-s-d","sfml-system-s-d", in this order.
5. Release -> Linker settings-> Add -> Then I added "sfml-graphics-s","sfml-window-s","sfml-system-s", in this order.
6."Name of the project" -> Compiler settings -> defines -> I added "SFML_STATIC"


still not working when i double click on the exe located in the project folder/bin/debug
i get the error: "sfml-graphics-2.dll not found" ... :( :( :( :(
 

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: How to statically link sfml with codeblocks
« Reply #4 on: January 08, 2020, 08:07:44 am »
Open your project file (it's XML) and search occurences of sfml-xxx without -s. Will be much easier than searching through the CodeBlocks UI.
Laurent Gomila - SFML developer

InculetAlexandru

  • Newbie
  • *
  • Posts: 4
    • View Profile
    • Email
Re: How to statically link sfml with codeblocks
« Reply #5 on: January 08, 2020, 11:39:57 pm »
Nvm, i managed to make the library from the source code using cmake ....

 

anything