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

Author Topic: Static Linking  (Read 2478 times)

0 Members and 1 Guest are viewing this topic.

Wqer

  • Guest
Static Linking
« on: January 14, 2014, 06:52:32 am »
.
« Last Edit: January 20, 2014, 04:22:21 am by Wqer »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10829
    • View Profile
    • development blog
    • Email
AW: Static Linking
« Reply #1 on: January 14, 2014, 07:44:41 am »
Did you read the tutorial? Have you defined SFML_STATIC?
Without the actual error we can't help you....
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10829
    • View Profile
    • development blog
    • Email
Re: Static Linking
« Reply #2 on: January 14, 2014, 09:40:07 pm »
These tutorials also have a look at the FAQ.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Xornand

  • Jr. Member
  • **
  • Posts: 78
  • C++ / Python
    • View Profile
Re: Static Linking
« Reply #3 on: January 16, 2014, 07:07:38 am »
If you're using the latest version from the repository, then you also need to link against the SFML's dependencies, i.e. OpenGL.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10829
    • View Profile
    • development blog
    • Email
Re: Static Linking
« Reply #4 on: January 17, 2014, 08:52:22 am »
I'm not sure what you mean. How is that done?
You might want to learn how to link things then. It's a crucial process in programming! ;)

Add opengl32 to the linking settings, but that's not all. If you have built from source, see here.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Xornand

  • Jr. Member
  • **
  • Posts: 78
  • C++ / Python
    • View Profile
Re: Static Linking
« Reply #5 on: January 17, 2014, 05:15:05 pm »
If you're developing on Windows in Visual Studio, make sure you have the following entries in the Linker -> Input -> Additional Dependencies in the project's properties (besides the standard SFML libraries):
  • freetype.lib
  • glew.lib
  • jpeg.lib
  • openal32.lib
  • opengl32.lib
  • sndfile.lib
  • winmm.lib

Xornand

  • Jr. Member
  • **
  • Posts: 78
  • C++ / Python
    • View Profile
Re: Static Linking
« Reply #6 on: January 18, 2014, 09:34:40 am »
I am not sure about Eclipse, however in Visual Studio (using the VC++ compiler) there is no need to recompile anything. It's a simple matter of pointing the linker to the directory of the .lib files that SFML uses (and already provides in its source directories).

As for opengl32.lib and winmm.lib, those files are provided automatically, given that they are specified in the linker's inputs - but again, perhaps Eclipse would require a different approach (especially if you're using a different compiler)?
« Last Edit: January 18, 2014, 10:17:31 am by Xornand »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10829
    • View Profile
    • development blog
    • Email
Re: Static Linking
« Reply #7 on: January 18, 2014, 10:22:13 am »
I can only point you again to the FAQ.

Eclipse uses GCC thus the libraries to link won't have an *.lib extensions, but *.a, however when specifying libraries for GCC, you don't include the extensions, but instead just write: sfml-graphics, winmm, glew, etc
The linker will then automatically search for winmm.a or libwinmm.a etc.

You should really learn how to use your tools (Eclipse, linker, compiler, etc).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

amir ramezani

  • Jr. Member
  • **
  • Posts: 81
  • i'm a programmer who can't see well
    • View Profile
    • download useful software!
    • Email
Re: Static Linking
« Reply #8 on: January 20, 2014, 07:34:32 pm »
you must link everything in order your game work fine!
if you can't see well, you can't test your applications and operating system well
my game engine:
allegro game creator
my operating system:
AmirOS

 

anything