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

Author Topic: [SOLVED] Thor undefined reference to sf::Image destructor.  (Read 2352 times)

0 Members and 2 Guests are viewing this topic.

Xilen

  • Newbie
  • *
  • Posts: 14
    • View Profile
[SOLVED] Thor undefined reference to sf::Image destructor.
« on: September 01, 2014, 03:28:39 am »
I'm having trouble getting thor to work on Ubuntu 14.04.
I compiled both SFML and Thor from source using the github repositories.

Example code:
#include <iostream>
#include <stdio.h>
#include <SFML/Graphics.hpp>
#include <Thor/Input.hpp>
using namespace std;
int main()
{
        sf::RenderWindow window(sf::VideoMode(640,480,32), "RPG Thing(?)",
                                                    sf::Style::Titlebar | sf::Style::Close);
        window.setVerticalSyncEnabled(false);
        window.setFramerateLimit(60);
        thor::ActionMap<string> map;
        map["quit"] = thor::Action(sf::Event::Closed);
        while (window.isOpen())
        {
                map.update(window);
                if (map.isActive("quit"))
                        window.close();
                window.clear();
                window.display();
               
        }
        return 0;
}

Here's the error:
Code: [Select]
//usr/local/lib/libthor.so: undefined reference to `sf::Image::~Image()'
//usr/local/lib/libthor.so: undefined reference to `sf::operator/(sf::Time, sf::Time)'
Compilation failed.
collect2: error: ld returned 1 exit status

Here's my compile command:
Code: [Select]
g++ -Wall -std=c++0x -c *.cpp -lthor -lsfml-graphics -lsfml-window -lsfml-systemAnd finally here's my build command:
Code: [Select]
g++ -Wall -std=c++0x -o main *.o -lthor -lsfml-graphics -lsfml-window -lsfml-system
I'm not entirely sure what's wrong. Could it possible be a version mismatch with Thor and SFML?
« Last Edit: September 01, 2014, 12:07:05 pm by Xilen »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Thor undefined reference to sf::Image destructor.
« Reply #1 on: September 01, 2014, 11:03:27 am »
It looks like the binaries are of an older version, where sf::operator/ (sf::Time, sf::Time) has not existed yet. Remove everything related to SFML and Thor, download the latest commits from both repositories, follow the install guides in the tutorial and it should work.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Xilen

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: Thor undefined reference to sf::Image destructor.
« Reply #2 on: September 01, 2014, 12:06:50 pm »
Alright, I hadn't even looked into that. Turns out, the I had the repository version of sfml installed which is apparently extremely dated. I removed those and rebuilt from source and everything works fine.