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:
//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:
g++ -Wall -std=c++0x -c *.cpp -lthor -lsfml-graphics -lsfml-window -lsfml-system
And finally here's my build command:
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?