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

Author Topic: Problem while linking sfml  (Read 41 times)

0 Members and 1 Guest are viewing this topic.

Yonis65

  • Newbie
  • *
  • Posts: 2
    • View Profile
Problem while linking sfml
« on: January 09, 2025, 12:30:19 pm »
Hello, I'm new to c++ but not coding. I'm having a lot of trouble to setup a project with sfml.
I followed the tutorial on the original website, and also multiple tutorial on youtube, step-by-step and I couldn't manage to get it to work. The strange thing is that I don't get any linker error and everything at the beginning seems to work fine, until I add some code to work with sfml(including something is enough)
#include <SFML/Graphics.hpp>
After I add this line I get 400+ errors, which are syntax error in the sfml files. I don't think it's a linker problem but I'm not sure. I'm using SFML 3.0.0 for Visual C++ 17 (2022) 64bit. These are the errors https://pastebin.com/mvAjtge9.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11075
    • View Profile
    • development blog
    • Email
Re: Problem while linking sfml
« Reply #1 on: January 09, 2025, 01:07:41 pm »
By C++17 in the migration guide, we don't mean Visual Studio 2022, but that you need to select the specific language standard, i.e. the flag that the error is pointing you to /std:c++17.

In the project properties: C/C++ > Language > C++ Language Standard > ISO C++17 Standard

Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Yonis65

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Problem while linking sfml
« Reply #2 on: January 09, 2025, 01:53:33 pm »
Thank you so much, that was the problem

 

anything