SFML community forums

Help => General => Topic started by: Shay9999 on July 22, 2011, 04:22:43 am

Title: Loading Resource
Post by: Shay9999 on July 22, 2011, 04:22:43 am
I'm having this issue with a project I'm doing and I'm unsure on how to do it.

When the program is finished, the files and libraries will be loaded from another folder (when they are needed). However, I have little to know knowledge on how to do this and I was wondering if anyone had a clue as to what to do ^_^

This is what I currently have (and what currently does not work):

Code: [Select]
LoadResource("\\system\\sfml-window-2.dll");
LoadResource("\\system\\sfml-window-d-2.dll");


I assume that it's because I'm supposed to use some other line of code with this, but MSDN is just not helpful >_< I need an example >_<.

All help is appreciated ^_^
Title: Loading Resource
Post by: Turbine on July 22, 2011, 09:18:32 am
Would copying those dll's into the executables directory or into "\Windows\System" be sufficient? Or do you like them in a separate directory?
Title: Loading Resource
Post by: Shay9999 on July 22, 2011, 07:41:35 pm
I would like them to be in a folder where my program would be:

MyProgram\ProgramFiles\DLLs

So the full link would be something like

C:\Program Files(x86)\MyCompany\MyProgram\ProgramFiles\DLLs
Title: Loading Resource
Post by: Shay9999 on July 22, 2011, 08:18:50 pm
Actually, it might just be easier (if this is even possible) to put all the .dll files into the .exe file.

is this possible? Is there a way I can take my resources (.dll files, pictures, etc.) and put them into my application?
Title: Loading Resource
Post by: Contadotempo on July 22, 2011, 08:54:17 pm
Yes, link to a static compilation of SFML (sfml-system-s.lib for example).
It will result in a bigger .exe file but that's pretty much it.

Don't forget the SFML_STATIC preprocessor in your project proprieties if you're using SFML 2.0.
Title: Loading Resource
Post by: Shay9999 on July 23, 2011, 03:11:47 am
Thank you!