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

Author Topic: SFML 2.5.0.1Graphic weird library error  (Read 1689 times)

0 Members and 1 Guest are viewing this topic.

wikingus

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
SFML 2.5.0.1Graphic weird library error
« on: May 17, 2018, 03:36:41 pm »
Hi
Sorry for my English.
I installed a new system.
Linux version 4.13.11-1-ARCH (builduser @ tobias) (gcc version 7.2.0 (GCC)) # 1 SMP PREEMPT Thu Nov 2 10:25:56 CET 2017

later I installed SFML z2.5.0.1 from the repository.

I have an error when I try to compile the program.

g ++ main.cpp -o main -lsfml-system -lsfml-window -lsfml-graphics
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../lib/libsfml-graphics.so: undefined reference to `powf@GLIBC_2.27 '


program is main.cpp
#include <SFML/Graphics.hpp>

int main()
{
    // Create the main window
    sf::RenderWindow app(sf::VideoMode(800, 600), "SFML window");

    // Load a sprite to display
    sf::Texture texture;
    if (!texture.loadFromFile("cb.bmp"))
        return EXIT_FAILURE;
    sf::Sprite sprite(texture);

        // Start the game loop
    while (app.isOpen())
    {
        // Process events
        sf::Event event;
        while (app.pollEvent(event))
        {
            // Close window : exit
            if (event.type == sf::Event::Closed)
                app.close();
        }

        // Clear screen
        app.clear();

        // Draw the sprite
        app.draw(sprite);

        // Update the window
        app.display();
    }

    return EXIT_SUCCESS;
}
What i do wrong?
Best Regards Damian

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: SFML 2.5.0.1Graphic weird library error
« Reply #1 on: May 17, 2018, 05:07:29 pm »
Your link order is wrong, sfml-graphics depends on sfml-window and sfml-window depends on sfml-system, thus the order needs to be sfml-graphics, sfml-window, sfml-system.

Otherwise I suggest you contact the Arch package maintainer, or maybe you haven't updated all your other packages correctly.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

wikingus

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: SFML 2.5.0.1Graphic weird library error
« Reply #2 on: May 17, 2018, 07:12:52 pm »
Hi
Im install gcc 8.1.0-1 and have next problem
error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory
when i install
gcc-ada , gcc-fortran , gcc-go , gcc-libs , gcc-objc , lib32-gcc-libs  and
 binutils >=2.28
gcc-libs =8.1.0-1
libmpc
lib32-gcc-libs (optional) - for generating code for 32-bit ABI

and now its works I just can not believe.
Best regards Damian