I'm sorry if I'm missing something obvious, but, with this code:
#include <SFML/Window.hpp>
#include <iostream>
#include <string>
int main()
{
std::cout << "Joystick #" << 0 << " connected:\n"
<< "Name:\t" << static_cast<std::string>(sf::Joystick::getIdentification(0).name) << '\n'
<< "Vendor:\t" << sf::Joystick::getIdentification(0).vendorId << '\n'
<< "Product:\t" << sf::Joystick::getIdentification(0).productId << '\n';
return 0;
}
Command to compile: g++ main.cpp -lsfml-system -lsfml-window
I am getting an undefined reference to sf::Joystick::getIdentification(unsigned int).
The rest of the Joystick functions seem alright.
OS: Arch Linux x86_64
Kernel: 3.15.1
g++: 4.9.0-20140604
SFML: latest from github (d73418261b)
As kind of pointed out, your link order is wrong. It should be:
g++ main.cpp -lsfml-window -lsfml-system
Can be easily remember as sfml-window depends on sfml-system.