Thread: SFML - Static Linking

  1. #1
    Registered User
    Join Date
    Aug 2014
    Posts
    26

    SFML - Static Linking

    I followed the tutorial here (I am trying to statically link the SFML libraries so that my end-result exe will have the DLL's embedded in it):
    SFML and Visual studio (SFML / Learn / 2.3 Tutorials)

    (1) I have added the following in CONFIGURATION PROPERTIES>>C/C++>>GENERAL>>ADDITIONAL INCLUDE DIRECTORIES:
    C:\\Path to my SFML Include Directory

    (2) I have added the following in CONFIGURATION PROPERTIES>>LINKER>>GENERAL>>ADDITIONAL LIBRARY DIRECTORIES:
    C:\\Path to my SFML Lib Directory

    (3) I have added the following in CONFIGURATION PROPERTIES>>C/C++>>PREPROCESSOR DEFINITIONS:
    SFML_STATIC;

    (4) I then added the following in CONFIGURATION PROPERTIES>>LINKER>>INPUT>>ADDITIONAL DEPENDENCIES:
    sfml-window-s-d.lib; sfml-system-s-d.lib; sfml-graphics-s-d.lib; sfml-audio-s-d.lib; opengl32.lib; freetype.lib; jpeg.lib; winmm.lib; gdi32.lib; openal32.lib; flac.lib; vorbisenc.lib; vorbisfile.lib; vorbis.lib; ogg.lib; winmm.lib;

    I am comparing the size of the the exe (the statically linked) to the one I had previously (the dynamically linked), and there does seem to be a size difference. Why am I still receiving an error message when I try to run it without the DLL's in the same directory?

    Even if you are not familiar with SFML, then any help regarding statically linking a DLL in general that may help me would be greatly appreciated!
    Last edited by c_lover; 08-05-2015 at 05:48 PM.

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    What error message? If you link statically, the DLL files won't be needed since they're embedded into the executable.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 1
    Last Post: 11-06-2014, 08:36 AM
  2. static library linking
    By jcfuller in forum C Programming
    Replies: 4
    Last Post: 10-07-2014, 10:43 AM
  3. RPM Depencies and static linking
    By SomeNYCGuy in forum Linux Programming
    Replies: 2
    Last Post: 12-06-2009, 12:58 PM
  4. Linking errors with static var
    By Elysia in forum C++ Programming
    Replies: 8
    Last Post: 10-27-2007, 05:24 PM
  5. static linking with Dev-c++/gcc
    By silk.odyssey in forum C Programming
    Replies: 6
    Last Post: 12-14-2003, 01:28 PM

Tags for this Thread