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

Author Topic: Linking to dll files windows separate file  (Read 1878 times)

0 Members and 1 Guest are viewing this topic.

LucasM

  • Newbie
  • *
  • Posts: 13
    • View Profile
    • Email
Linking to dll files windows separate file
« on: February 28, 2017, 05:12:09 pm »
It is a pain to always have to copy the dlls over to where my test sfml programs are in windows.  I dont know much about it, but is there some way, such as writing a manifest file or having the libraries load in dynamically at run time with a call to loadlibrary so i can just refer to the dll location as is installed in the sfml folder.  Using the filepath.  (When i hit rebuild project it erases the dlls).  Without changing PATH.

Dont know anything about manifests but from what i have read it seems to be an answer from what i understood.

Static linking might help too but asks for jpeg.lib which i dont have installed (I dont think)
Not sure which library that is. (Graphics module)

Tdm-gcc compiler... newer version that can use c++11 features.  5.3 off the top of my head.  Using codelite.  (Vc++ community installed though somewhat overly complicated as an ide for me)

Thank you.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10827
    • View Profile
    • development blog
    • Email
Linking to dll files windows separate file
« Reply #1 on: February 28, 2017, 05:21:47 pm »
The probably easiest solution is to cooy the DLLs into a directory that is in PATH. That way Windows will automatically find the DLLs. The better solution would probably be to create your own directory and add thta syatem wide to PATH, so you don't pollute for example the system32 directory.
The issue this has, is if you have to support multiple versions of SFML.

My preferred solution is to just statically build and link SFML. All the additional dependencies you have to link are provided in the extlibs directory of SFML's source distribution.
This however still leaves you with the openal32.dll, which can't be linked statically due to its LGPL licensing.

The manifests should be able to provide more flexibility, unfortunately I have no idea how they work.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything