SFML community forums

Help => General => Topic started by: codevenkat on August 23, 2020, 12:39:21 am

Title: Error "cannot open file 'sfml-graphics-d.lib'
Post by: codevenkat on August 23, 2020, 12:39:21 am
I compiled SFML using the tutorial, dynamically. I used VS2019.

In my project, I added the include\ folder, and in linker added the lib\ folder. I then added this to the input options:
sfml-graphics-d.lib
sfml-window-d.lib
sfml-system-d.lib


Since I compiled it as a dynamic lib, I added the following DLL files to the directory where my executable is generated(copied from lib\Debug\):
sfml-graphics-d-2.dll
sfml-window-d-2.dll
sfml-system-d-2.dll


Any help would be appreciated, thanks.
Title: Re: Error "cannot open file 'sfml-graphics-d.lib'
Post by: MarbleXeno on August 23, 2020, 11:16:58 pm
Don't copy DLLs from include or lib, in sfml folder it should be folder called bin, from this folder copy all DLLs and paste it in debug.
Title: Re: Error "cannot open file 'sfml-graphics-d.lib'
Post by: codevenkat on August 24, 2020, 03:16:58 am
Don't copy DLLs from include or lib, in sfml folder it should be folder called bin, from this folder copy all DLLs and paste it in debug.

Hmm, I'm not able to find a bin/ folder, where would this be located? I built into a ./build/ folder where there is the lib folder.
Title: Re: Error "cannot open file 'sfml-graphics-d.lib'
Post by: Zel on August 24, 2020, 04:44:41 am
So when you are coping files from the SFML zip there is a folder marked  /lib/  this is where your .a and .lib files live. Your .DLL folders live in a folder called /bin/  in the directory tree inside the zipfile. These .dll files need to be put in the same directory as your newly built executable.
Title: Re: Error "cannot open file 'sfml-graphics-d.lib'
Post by: Laurent on August 24, 2020, 08:13:37 am
You should build the "install" target, to get a release folder similar to what you can download on the website. It is explained in the tutorial.
Title: Re: Error "cannot open file 'sfml-graphics-d.lib'
Post by: codevenkat on August 24, 2020, 07:28:56 pm
You should build the "install" target, to get a release folder similar to what you can download on the website. It is explained in the tutorial.

Hmm I did build all the targets, I just made it a VS .sln file and clicked *build solution* which should've built all targets, right?
Title: Re: Error "cannot open file 'sfml-graphics-d.lib'
Post by: Laurent on August 24, 2020, 10:35:30 pm
No. The install target ("INSTALL" in your VS solution) must be built manually, it is not part of what builds by default. The same way you have to explicitly "make install" after "make" when using makefiles.