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

Author Topic: Error "cannot open file 'sfml-graphics-d.lib'  (Read 9986 times)

0 Members and 1 Guest are viewing this topic.

codevenkat

  • Newbie
  • *
  • Posts: 3
    • View Profile
Error "cannot open file 'sfml-graphics-d.lib'
« 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.
« Last Edit: August 23, 2020, 12:52:33 am by codevenkat »

MarbleXeno

  • Guest
Re: Error "cannot open file 'sfml-graphics-d.lib'
« Reply #1 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.

codevenkat

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Error "cannot open file 'sfml-graphics-d.lib'
« Reply #2 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.

Zel

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Error "cannot open file 'sfml-graphics-d.lib'
« Reply #3 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Error "cannot open file 'sfml-graphics-d.lib'
« Reply #4 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.
Laurent Gomila - SFML developer

codevenkat

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Error "cannot open file 'sfml-graphics-d.lib'
« Reply #5 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Error "cannot open file 'sfml-graphics-d.lib'
« Reply #6 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.
Laurent Gomila - SFML developer

 

anything