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

Author Topic: Cannot Compile with Latest Version  (Read 387 times)

0 Members and 1 Guest are viewing this topic.

technologicguy

  • Newbie
  • *
  • Posts: 6
    • View Profile
Cannot Compile with Latest Version
« on: December 31, 2024, 09:32:17 pm »
Greetings,
I am new to SFML and am trying to run the simple test program found here: https://www.sfml-dev.org/tutorials/2.6/start-linux.php. but I am unable to compile the code, and getting errors due to a version problem.  Even though I've downloaded the latest version and confirmed I'm on 3.0.0 it's still telling me,
"SFML found but version too low (requested: 2, found: 1.x)"
I've attached a screenshot from my terminal of the error, and I'm very confused why it's saying version 1.x and requested 2, when I have version 3 installed.  Thoughts?  Any help is greatly appreciated!

Thrasher

  • SFML Team
  • Jr. Member
  • *****
  • Posts: 60
    • View Profile
Re: Cannot Compile with Latest Version
« Reply #1 on: December 31, 2024, 09:54:49 pm »
Stop using FindSFML.cmake. That's been out of use since like SFML 2.4 or something like that.

technologicguy

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Cannot Compile with Latest Version
« Reply #2 on: December 31, 2024, 10:01:04 pm »
Okay "Thrasher" well that doesn't tell me a thing because as I mentioned, I'm new to SFML so is there anyone who knows how to use forethought in these circumstances to properly communicate, or is this going to be a whole social handicap issue with this community?  If I had to guess I would say the ladder, but hopefully someone who is at least decent will respectfully respond and provide helpful insight because as of now, I'm still in the exact same state as I first posted and one douche named Thrasher who once again confirmed why I should never trust forums.  Any professionals here, or all just kids in their moms basement?

Thrasher

  • SFML Team
  • Jr. Member
  • *****
  • Posts: 60
    • View Profile
Re: Cannot Compile with Latest Version
« Reply #3 on: December 31, 2024, 11:26:36 pm »
Sorry I'm just a 14 year old but my parents don't have a basement

technologicguy

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Cannot Compile with Latest Version
« Reply #4 on: December 31, 2024, 11:32:26 pm »
Now your response to my initial inquiry makes complete sense.  If there are no professionals here, then my code will not easily get resolved, and you are clearly not someone who wants or can help, so you don't need to respond to me anymore.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11070
    • View Profile
    • development blog
    • Email
Re: Cannot Compile with Latest Version
« Reply #5 on: December 31, 2024, 11:46:29 pm »
Please use a different tone. Nobody here owes you anything and the written content, while maybe not as helpful as you hoped, was factually correct.

If you want to use SFML 3, I suggest using the SFML 3 tutorials: https://www.sfml-dev.org/tutorials/3.0/getting-started/visual-studio/

The FindSFML.cmake shouldn't be used anymore. See also the CMake Migration post: https://en.sfml-dev.org/forums/index.php?topic=24070.0

Personally I recommend to use the CMake template, which has the benefit of building SFML as well: https://www.sfml-dev.org/tutorials/3.0/getting-started/cmake/
« Last Edit: January 01, 2025, 02:33:19 am by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq/
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

technologicguy

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Cannot Compile with Latest Version
« Reply #6 on: December 31, 2024, 11:54:35 pm »
I give back what I'm handed.  I don't owe you guys any kindness, but I did in my initial post, and the response literally did nothing because I don't know what it means, so factual or not, it's entirely irrelevant.  Enabling others bad behavior by never calling them out for their poor behavior is what has brought this world to the poison it's reached so you aren't helping either.  Could have just left the links without the extra verbiage, but I'm now responding in regard to your demeanor as well.  If you want respect from me, you need to give it back as I did from the very beginning.  Very simple.  I gave you respect from the beginning but it doesn't seem to have mattered, and ONCE again, the poison of online forums reigns supreme.  You can change your tone too or not speak to me at all, because speaking to me that way is only going to get this kind of response in return.  Happy new year asshole.

kojack

  • Sr. Member
  • ****
  • Posts: 352
  • C++/C# game dev teacher.
    • View Profile
Re: Cannot Compile with Latest Version
« Reply #7 on: January 01, 2025, 12:14:47 am »
(A couple of other posts came in while I was writing this, so point 1 already mentioned)
There's a few issues here.
First, it's not a good idea to use the 2.6 tutorial page for 3.0. SFML 3.0 has changed quite a bit and its code isn't compatible. There are tutorials for 3.0 here: https://www.sfml-dev.org/tutorials/3.0/

Second, the FindSFML.Cmake issue. That file was removed from SFML in March 2018. It was part of SFML 2.4 and earlier. So you are actually using an outdated version of SFML.
If you got SFML from Github, you will need to change the branch you are on. The error said you are on SFML 1.x, which is from 14 years ago.
I tried following the linux install step from the 2.6 tutorial and it gave me SFML 2.5. No findsfml was there. (Note:  I did this on an ARM based device, maybe an x64 would give me the right version? I'm not a Linux developer)

Third, you are following a linux tutorial but your screenshot says apple clang. Isn't that part of xcode for macos? I'm REALLY not a mac developer so I could be wrong on that. Maybe one of the SFML tutorials on macos would be more successful?
« Last Edit: January 01, 2025, 12:30:55 am by kojack »

technologicguy

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Cannot Compile with Latest Version
« Reply #8 on: January 01, 2025, 12:35:57 am »
"(A couple of other posts came in while I was writing this, so point 1 already mentioned)"
At this stage, that is a mute point and I've voiced my response (and rightfully so) so I'm ready to actually discuss this if people want to.  Full transparency, I don't know either, as mentioned in my first post this is my first time doing anything with SFML.  The version that my terminal in my mac says I'm using is 3.0.0
attached below.  The link I sent from this website is the only one I found for the mac, and from a tutorial I was following online.  Something is off because the video was from 2021, so I'm confused how the uploader was able to get their version to work since it was well after 2018.  Not questioning your experience on the subject, I'm just unable to understand why it's not working in relation to your response.  Now, I will say, even though I was unable to get that sample program to run from the linux page that I sent, the whole reason I'm trying to get this set up on my computer in the first place is to run this program here: https://github.com/SundeepK/Daylight and I cannot, which was why I took a step back and decided to follow a tutorial to setup SFML on my mac.  That daylight program is what I need to compile and I can't successfully run it, and I have no idea how to go about making it work.  I've installed everything that was expected in order to get SFML on my computer, so I'm at a standstill.

kojack

  • Sr. Member
  • ****
  • Posts: 352
  • C++/C# game dev teacher.
    • View Profile
Re: Cannot Compile with Latest Version
« Reply #9 on: January 01, 2025, 01:13:14 am »
Ah, that's making sense now. The FindSFML.cmake file is coming from the Daylight project, not your install of SFML. Daylight was written for a version of SFML from 11 years ago (I'm guessing SFML 2.1 or 2.0) and provided its own FindSFML.

Generally I don't use SFML in the usual way. I grab the latest source, run cmake-gui (on Windows) over it to build everything, then I copy out the headers and libs and avoid cmake after that, manually linking it into the engine I built. I've never actually used cmake to set up a new sfml project. :) So I can't give much advice on cmake builds on a mac.
The Daylight project doesn't look too big. My guess would be to first get a default SFML project compiling using the tutorial eXpl0it3r linked to for getting started with cmake. Once that's building fine, take the files from the Daylight and add them in. It's going to need changes, SFML 3.0 changed a lot, code from 2.1 or earlier definitely won't work as is.

technologicguy

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Cannot Compile with Latest Version
« Reply #10 on: January 01, 2025, 01:45:04 am »
Except the other screenshot that I sent was from the other code that I was trying to run from that Linux link here on the SFML site.  I can follow that other link for version 3.0 that's fine, however, based on what you said, along with the fact that it's the Daylight project that I'm interested in being able to test, I would much rather remove, re-install, or just switch to my Windows computer at this point, because this is the first time I've ever used cmake as well, and I honestly don't like it at all.  Everything I've ever done before was simply the g++ compiler through the terminal, or the DevC++ compiler on my Windows machine, and I am more than happy to hear you out and your approach.  I am completely fine abandoning the cmake approach if I'm able to.  Otherwise, if this Daylight project has no other way around that, and I have to stick to using cmake, then I will, but I'm all ears if you have a better way of making this project work in a Windows environment.  I can easily sign into my Windows machine.  I'm only on my mac because it's my laptop.

kojack

  • Sr. Member
  • ****
  • Posts: 352
  • C++/C# game dev teacher.
    • View Profile
Re: Cannot Compile with Latest Version
« Reply #11 on: January 01, 2025, 02:18:57 pm »
Easiest way to go without caring about cmake is to go to the main sfml download page: https://www.sfml-dev.org/download/sfml/3.0.0/#all-os
On there are prebuilt versions of SFML for windows (visual studio or gcc), linux and macos.
THese archives contain just the headers and libraries. If you set up the include paths and link the libs, it should be possible to build even from just a command line.

The main downside (and the reason the cmake template is usually recommended) is that GCC in particular is very sensitive to version differences. If you aren't using the identical version to the prebuilt libraries, it can fail. The cmake version makes sure everything is built the same. But as long as you use the compiler listed on the download page, it should work.

(Cmake is great to use for cross platform projects. But my personal game things are only for windows, so it gets in the way more than it helps, for my particular use case)