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

Author Topic: Can't compile code from tutorial  (Read 2715 times)

0 Members and 1 Guest are viewing this topic.

xeniac

  • Newbie
  • *
  • Posts: 5
    • View Profile
Can't compile code from tutorial
« on: March 26, 2022, 01:08:24 pm »
Hello everyone!
I'm trying to compile program from this tutorial: https://www.sfml-dev.org/tutorials/2.5/start-linux.php. I have Ubuntu 20.04, SFML 2.5.1. My sequence of actions:
g++ -c main.cpp -I/home/xenia/Documents/SFML/include
g++ main.o -o sfml-app -L/home/xenia/Documents/SFML/lib -lsfml-graphics -lsfml-window -lsfml-system

Full error message is here: https://anotepad.com/note/read/9986fexc.

I do not know what to do. I searched the internet and it didn't come up with any results. A year ago, I downloaded the library and wrote simple examples, there was no such error. I remember that I started exactly the same way. Now I've decided to use it again.

Thank you in advance!
« Last Edit: March 26, 2022, 03:20:08 pm by xeniac »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Can't compile code from tutorial
« Reply #1 on: March 26, 2022, 04:36:04 pm »
You need to install the necessary dependencies.
See also: https://www.sfml-dev.org/faq.php#tr-lnx-compile
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

xeniac

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Can't compile code from tutorial
« Reply #2 on: March 26, 2022, 04:45:57 pm »
I did sudo apt-get install libx11-dev libgl1-mesa-dev libudev-dev libfreetype6-dev libopenal-dev libflac-dev libvorbis-dev.

It didn't help, unfortunately. The errors are the same: https://anotepad.com/note/read/4eyicmm3

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Can't compile code from tutorial
« Reply #3 on: March 26, 2022, 05:47:53 pm »
Did you build SFML yourself?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

xeniac

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Can't compile code from tutorial
« Reply #4 on: March 26, 2022, 06:15:59 pm »
No, I didn't. Maybe try uninstalling and reinstalling?

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Can't compile code from tutorial
« Reply #5 on: March 26, 2022, 09:29:15 pm »
did you install it trough "apt-get install libsfml-dev"?
Visit my game site (and hopefully help funding it? )
Website | IndieDB

xeniac

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Can't compile code from tutorial
« Reply #6 on: March 29, 2022, 09:55:06 pm »
Yes, I tired the library with this command.

I just reinstalled it. It did not help.

Stauricus

  • Sr. Member
  • ****
  • Posts: 369
    • View Profile
    • A Mafia Graphic Novel
    • Email
Re: Can't compile code from tutorial
« Reply #7 on: March 30, 2022, 12:35:20 pm »
ok, so its probably not about missing dependencies.

are you using some IDE, like Code::Blocks of Visual Studio?
Visit my game site (and hopefully help funding it? )
Website | IndieDB

xeniac

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Can't compile code from tutorial
« Reply #8 on: March 30, 2022, 07:41:50 pm »
I write code in Sublime Text, but compile and run it manually on the command line.