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

Author Topic: Please help (SOLVED!!! Thank you!)  (Read 4252 times)

0 Members and 1 Guest are viewing this topic.

Tehcooky

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Please help (SOLVED!!! Thank you!)
« on: May 13, 2018, 05:10:59 pm »
-------
Background to problem (skip if uninterested)
-------
Okay so this is the same problem I was experiencing before I gave programming a break. I had the
frame work written for a decent size project I was going to be working on, then I upgraded to the
newest version of VS and to windows 10 and I guess ive done something stupid with the setup
because nothing works. For the purpose of trying to get it working, I always first set up an empty
project following the tutorial and use the example code to test it.
-------

Operating system: Windows 10
Visual studio version: Visual studio 2017
SFML Version: 2.5.0-vc15-32-bit

So I have an empty project, with SFML 2.5.0 in the same directory as my project. I figrured Id link
statically, merely to save the headache of copying files around.

In all configurations I have:
C/C++ >> General >> Additional Include Directories >> linked to the include folder
Linker >> General >> Additional Library Directories >> linked to the lib folder
C/C++ >> Preprocessor >> SFML_STATIC

in my debug I have:
Linker >> input >> additional dependencies
sfml-graphics-s-d.lib
sfml-window-s-d.lib
sfml-system-s-d.lib

in release i have:
Linker >> input >> additional dependencies
sfml-graphics-s.lib
sfml-window-s.lib
sfml-system-s.lib

Then I simple have a CPP file in source files called main.cpp where i have posted the example code,
on their tutorial page.

The intellesence isnt give me any issues, but when I run it, in either debug or release, it breaks and gives
me 61 errors:
some of them are LNK2019 and some LNK2001. Not really sure what is going on, Im hoping someone
can help me by pointing out something stupid I have done. Thank you for reading in advance.


« Last Edit: May 13, 2018, 06:04:50 pm by Tehcooky »

Geheim

  • Full Member
  • ***
  • Posts: 201
    • View Profile
    • Email
Re: Please help
« Reply #1 on: May 13, 2018, 05:53:45 pm »
You also have to link to some additional dependencies, which you can find in the tutorials or in the FAQ.

Also since SFML 2.5 you don't need jpeg anymore (maybe that should be updated in the FAQ as well?)
Failing to succeed does not mean failing to progress!

Tehcooky

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Please help
« Reply #2 on: May 13, 2018, 05:58:06 pm »
Oh my god im so stupid... yeah i just read this.

Starting from SFML 2.2, when static linking, you will have to link all of SFML's dependencies to your project as well. This means that if you are linking sfml-window-s.lib or sfml-window-s-d.lib for example, you will also have to link opengl32.lib, winmm.lib and gdi32.lib. Some of these dependency libraries might already be listed under "Inherited values", but adding them again yourself shouldn't cause any problems.

Sorry for wasting your time, Ive been having a bad day and I must have just not seen this