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

Author Topic: Sfml error undefined reference  (Read 2757 times)

0 Members and 1 Guest are viewing this topic.

artelisaris

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Sfml error undefined reference
« on: January 31, 2015, 09:17:37 pm »
I have been trying to make it work my whole day and I just can make it work.Here is the build log.
Code: [Select]



-------------- Clean: Debug in sfml (compiler: GNU GCC Compiler)---------------


Cleaned "sfml - Debug"


-------------- Build: Debug in sfml (compiler: GNU GCC Compiler)---------------


mingw32-g++.exe -Wall -fexceptions -DSFML_STATIC -g -IC:\SFML-2.2\include -c C:\Users\visu\Desktop\c++\sfml\main.cpp -o obj\Debug\main.o
mingw32-g++.exe -LC:\SFML-2.2\lib -o bin\Debug\sfml.exe obj\Debug\main.o   -lsfml-graphics-d -lsfml-window-d -lsfml-system-d
obj\Debug\main.o: In function `main':
C:/Users/visu/Desktop/c++/sfml/main.cpp:5: undefined reference to `sf::String::String(char const*, std::locale const&)'
C:/Users/visu/Desktop/c++/sfml/main.cpp:5: undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
C:/Users/visu/Desktop/c++/sfml/main.cpp:5: undefined reference to `sf::RenderWindow::RenderWindow(sf::VideoMode, sf::String const&, unsigned int, sf::ContextSettings const&)'
C:/Users/visu/Desktop/c++/sfml/main.cpp:6: undefined reference to `sf::CircleShape::CircleShape(float, unsigned int)'
C:/Users/visu/Desktop/c++/sfml/main.cpp:7: undefined reference to `sf::Color::Green'
C:/Users/visu/Desktop/c++/sfml/main.cpp:7: undefined reference to `sf::Shape::setFillColor(sf::Color const&)'
C:/Users/visu/Desktop/c++/sfml/main.cpp:15: undefined reference to `sf::Window::close()'
C:/Users/visu/Desktop/c++/sfml/main.cpp:12: undefined reference to `sf::Window::pollEvent(sf::Event&)'
C:/Users/visu/Desktop/c++/sfml/main.cpp:18: undefined reference to `sf::Color::Color(unsigned char, unsigned char, unsigned char, unsigned char)'
C:/Users/visu/Desktop/c++/sfml/main.cpp:18: undefined reference to `sf::RenderTarget::clear(sf::Color const&)'
C:/Users/visu/Desktop/c++/sfml/main.cpp:19: undefined reference to `sf::RenderStates::Default'
C:/Users/visu/Desktop/c++/sfml/main.cpp:19: undefined reference to `sf::RenderTarget::draw(sf::Drawable const&, sf::RenderStates const&)'
C:/Users/visu/Desktop/c++/sfml/main.cpp:20: undefined reference to `sf::Window::display()'
C:/Users/visu/Desktop/c++/sfml/main.cpp:9: undefined reference to `sf::Window::isOpen() const'
C:/Users/visu/Desktop/c++/sfml/main.cpp:23: undefined reference to `sf::RenderWindow::~RenderWindow()'
C:/Users/visu/Desktop/c++/sfml/main.cpp:23: undefined reference to `sf::RenderWindow::~RenderWindow()'
C:/Users/visu/Desktop/c++/sfml/main.cpp:23: undefined reference to `sf::RenderWindow::~RenderWindow()'
obj\Debug\main.o: In function `ZN2sf11CircleShapeD1Ev':
C:/SFML-2.2/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `vtable for sf::CircleShape'
C:/SFML-2.2/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `vtable for sf::CircleShape'
C:/SFML-2.2/include/SFML/Graphics/CircleShape.hpp:41: undefined reference to `sf::Shape::~Shape()'

pls help.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Sfml error undefined reference
« Reply #1 on: January 31, 2015, 09:31:11 pm »
The static libraries have the -s suffix. This is clearly explained in the tutorial.
Laurent Gomila - SFML developer

artelisaris

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Sfml error undefined reference
« Reply #2 on: February 01, 2015, 01:39:39 pm »
I put -s to the libraries same result :-\

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Sfml error undefined reference
« Reply #3 on: February 01, 2015, 01:44:46 pm »
Can you show your new build log?
Laurent Gomila - SFML developer

artelisaris

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: Sfml error undefined reference
« Reply #4 on: February 01, 2015, 02:03:27 pm »
Fixed it.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Sfml error undefined reference
« Reply #5 on: February 01, 2015, 02:45:08 pm »
So what was the problem?
Laurent Gomila - SFML developer