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

Author Topic: error LNK1104: cannot open file 'SFML-graphics-s.lib'  (Read 6715 times)

0 Members and 2 Guests are viewing this topic.

user123

  • Newbie
  • *
  • Posts: 12
    • View Profile
error LNK1104: cannot open file 'SFML-graphics-s.lib'
« on: August 01, 2014, 05:55:14 pm »
When building the example program (the one that displays a window),
I get this error:
error LNK1104: cannot open file 'SFML-graphics-s.lib'
What do I need to do to get this to work?
I have been trying stuff for multiple days now, its really frustrating.


Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: error LNK1104: cannot open file 'SFML-graphics-s.lib'
« Reply #1 on: August 01, 2014, 06:05:52 pm »
In general:

1. You need SFML installed.
2. You need to point the linker at the location where the library is installed.
3. You need to include sfml-graphics in the list of libraries to actually link when building your application.

Nothing SFML specific about that. That's what you need for any C++ library.
« Last Edit: August 01, 2014, 06:14:41 pm by Jesper Juhl »

user123

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: error LNK1104: cannot open file 'SFML-graphics-s.lib'
« Reply #2 on: August 01, 2014, 06:15:49 pm »
In general:

1. You need SFML installed.
2. You need to point the linker at the location where the library is installed.
3. You need to include sfml-graphics in the list of libraries to actually link when building your application.

Nothing SFML specific about that. That's what you need for any C++ library.
I did all of that...

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: error LNK1104: cannot open file 'SFML-graphics-s.lib'
« Reply #3 on: August 01, 2014, 06:20:17 pm »
I did all of that...
Obviously not. If you had it would work.

Let's dig a bit deeper:

What compiler?
What version of SFML? (custom compiled or pre-built?)
Installed to where?
What does the exact compiler/linker command line look like?
Since you seem to be trying to link static versions of the library, are you defining SFML_STATIC?
« Last Edit: August 01, 2014, 07:40:48 pm by Jesper Juhl »

user123

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: error LNK1104: cannot open file 'SFML-graphics-s.lib'
« Reply #4 on: August 09, 2014, 05:36:36 pm »
I did all of that...
Obviously not. If you had it would work.

Let's dig a bit deeper:

What compiler?
What version of SFML? (custom compiled or pre-built?)
Installed to where?
What does the exact compiler/linker command line look like?
Since you seem to be trying to link static versions of the library, are you defining SFML_STATIC?
Compiler?
I cannot find , Visual Studio 2013 Express, default settings..
SFML 2.1, mixed, ive been working on this for ages
Installed to multiple locations
Yes, SFML_STATIC is defined.
Please help, ive trying to get this linker stuff to work for 3 weeks....

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: error LNK1104: cannot open file 'SFML-graphics-s.lib'
« Reply #5 on: August 09, 2014, 05:48:06 pm »
Since you omitted half of the information that you were asked for and kept the other half very vague ("multiple locations", "mixed"), it's not possible to help you. As you are the one who requests help, you should show some initiative to at least describe your problem, so that we don't have to ask every single thing multiple times. Please read this thread (especially the points "Check basic stuff" and "Give details").

And instead of trying randomly for 3 weeks, you should read the tutorial once, but very carefully. Every step is precisely explained. Make absolutely sure the specified linker path is correct and the libraries are actually there, because in that case the libraries will be found by the linker.

By the way: even if it may not matter on Windows, the library's name is sfml-graphics-s.lib and not SFML-graphics-s.lib. That's just one example where you deviate from the instructions; make sure you fix all of them.
« Last Edit: August 09, 2014, 05:51:51 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything