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

Author Topic: sfml with gcc 5.2  (Read 4169 times)

0 Members and 1 Guest are viewing this topic.

paupav

  • Full Member
  • ***
  • Posts: 155
    • View Profile
    • Email
sfml with gcc 5.2
« on: February 03, 2016, 10:39:29 pm »
compile it and put on the website plox
I'm getting error message:   undefined reference to `sf::Texture::loadFromFile(std::string const&, sf::Rect<int> const&)'|
« Last Edit: February 03, 2016, 10:42:35 pm by paupav »

Hapax

  • Hero Member
  • *****
  • Posts: 3075
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: sfml with gcc 5.2
« Reply #1 on: February 03, 2016, 10:44:46 pm »
This is not a "general discussion"; this is a help request and should be posted in the help forums.
You should know this. You've posted there a lot!

Make sure you're linking the libraries.
Selba Ward - SFML drawables
Kairos - Timing Library
Rectangular Boundary Collision - Rectangular SAT Collision

Hapaxia Links

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10390
    • View Profile
    • development blog
    • Email
sfml with gcc 5.2
« Reply #2 on: February 03, 2016, 11:00:17 pm »
Just build SFML from source, it's not that complicated.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://dev.my-gate.net/

paupav

  • Full Member
  • ***
  • Posts: 155
    • View Profile
    • Email
Re: sfml with gcc 5.2
« Reply #3 on: February 04, 2016, 02:56:50 pm »
It is still not working, even after compiling it. I still have the same error message undefined reference to `sf::Font::loadFromFile(std::string const&)'|
and similar errors:
(click to show/hide)

Make log:
(click to show/hide)
Code is correct and libraries are correctly linked.
Code: https://github.com/paupav/boxGame
« Last Edit: February 04, 2016, 08:59:24 pm by paupav »

dabbertorres

  • Hero Member
  • *****
  • Posts: 506
    • View Profile
    • website/blog
Re: sfml with gcc 5.2
« Reply #4 on: February 05, 2016, 04:06:18 am »
You're probably not linking to the newly created libraries.

You're not showing your compile/link commands.

Also, why are you using gcc 5.2? 5.3 fixes bugs in 5.2.

paupav

  • Full Member
  • ***
  • Posts: 155
    • View Profile
    • Email
Re: sfml with gcc 5.2
« Reply #5 on: February 05, 2016, 09:41:57 am »
That's the version in the Ubuntu 15.10

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10390
    • View Profile
    • development blog
    • Email
Re: sfml with gcc 5.2
« Reply #6 on: February 05, 2016, 01:50:11 pm »
My guess would be that you're not linking against sfml-system or not in the correct order. Can you provide the full build command?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://dev.my-gate.net/

paupav

  • Full Member
  • ***
  • Posts: 155
    • View Profile
    • Email
Re: sfml with gcc 5.2
« Reply #7 on: February 05, 2016, 03:42:35 pm »
I'm usually using CodeBlocks

EDIT: it seems that I just have to define const strings instead of just writing in file names.
e.g
const std::string menuFS = "menu.ttf";
font.loadFromFile(menuFS);

instead of:
font.loadFromFile("menu.ttf");
« Last Edit: February 05, 2016, 03:50:30 pm by paupav »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10390
    • View Profile
    • development blog
    • Email
Re: sfml with gcc 5.2
« Reply #8 on: February 05, 2016, 04:06:54 pm »
sfml-network also depends on sfml-system so you'd have to move sfml-system one position down, however that has nothing to do with the error.

You can still extract the verbose build command from Code::Blocks.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://dev.my-gate.net/

paupav

  • Full Member
  • ***
  • Posts: 155
    • View Profile
    • Email
Re: sfml with gcc 5.2
« Reply #9 on: February 05, 2016, 04:37:53 pm »
It is working now for some reason. I've just updated Ubuntu and I've put sfml-network above sfml-system in linker settings.