Hi,
I'm trying to use toString() in sf::ipAddress ubt I have this error :
undefined reference « sf::IpAddress::toString[abi:cxx11]() const »
I can use other methods like toInteger() from sf::IpAddress too. I think linkage is good.
Here what I'm trying to do :
#include<iostream>
#include<SFML/Network.hpp>
#include<SFML/System.hpp>
int main(){
sf::IpAddress ad("192.168.1.98");
std::string a = ad.toString();
std::cout << "a : " << a << std::endl;
return 0;
}
I have the same error when I'm trying to put and extract std::string into a sf::Packet :
#include<iostream>
#include<SFML/Network.hpp>
#include<SFML/System.hpp>
int main(){
sf::Packet pa;
std::string b = "hello";
pa << b;
b = "";
if(pa >> b){
std::cout << "string : " << b << std::endl;
}
return 0;
}
Undefined reference « sf::Packet::operator<<(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<ch
ar> > const&) »
And a part of the makefile :
CFLAGS=-Wall -Wno-unused-parameter -Wextra -ggdb -ansi -Wpedantic -std=c++11
LDFLAGS=-I/include/SFML/ -Llib -lsfml-network -lsfml-system
Could you help me to correct this please ?