Hey all,
I am creating game and i need download additional music file from internet. I tried do it and... I did.
But there is a problem. Program works only in debug mode. When i switch to release and i try download or upload file it crashes. Code:
#include <SFML/Network.hpp>
#include <iostream>
using namespace sf;
using namespace std;
// Normally there are good texts
string login = "";
string password= "";
string adres = "";
int main()
{
Ftp ftp;
Ftp::Response odp = ftp.connect(sf::IpAddress(adres.c_str()),21,sf::seconds(3));
if(odp.isOk())
cout<<"Connected!"<<endl;
else
{
cout<<"Connecting error!"<<endl;
getchar();
return 1;
}
odp = ftp.login(login,password);
if(odp.isOk())
cout<<"Login succes!"<<endl;
else
{
cout<<"Bad login or password"<<endl;
cin.get();
return 1;
}
cout<<"Downloading..."<<endl;
odp = ftp.download("VexentoGlow.ogg","",sf::Ftp::Binary);
if(odp.isOk())
cout<<"Download complete!"<<endl;
else
cout<<"Error!"<<endl;
getchar();
ftp.disconnect();
return 0;
}
It crashes in:
ftp.download("VexentoGlow.ogg","",sf::Ftp::Binary);
In debug mode it works good. It is SFML bug I suppose.
Please help!