I have a problem when compiling.Keep getting these errors.
http://prntscr.com/1w4ztsHeres the code
#include <iostream>
#include <SFML/Network.hpp>
using namespace std;
class NewBot{
sf::TcpSocket socket;
int ChatID;
public:
bool Connect(string ip,int port);
bool sendPackets(char data[100]);
string recievePackets();
NewBot(int k,int id);
};
NewBot::NewBot(int k,int id){
string ip="151.5151.15151.5418541";
int port=10014;
if(this->Connect(ip,port)){
cout <<"Test1";
//Room Number here
char sendthingy[100]="<y r=\"15\" m=\"1\" />";
this->sendPackets(sendthingy);
cout << this->recievePackets();
}
}
bool NewBot::Connect(string ip,int port){
sf::Socket::Status status=socket.connect(ip,port);
bool returnvalue;
if(status!=sf::Socket::Done){
returnvalue=false;
}
else{
returnvalue=true;
}
return returnvalue;
}
bool NewBot::sendPackets(char data[100]){
if(socket.send(data,100)!=sf::Socket::Done){
cout<<"Error Could not send Packets";
return false;
}
else{
return true;
}
}
string NewBot::recievePackets(){
char data[100];
std::size_t received;
socket.receive(data, 100, received);
return data;
}
int main(){
int k,id; cin>>k; cin>>id;
NewBot Bot(k,id);
}
I compiled it with sfml 2.1