Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Problem sending a request  (Read 4205 times)

0 Members and 1 Guest are viewing this topic.

Austech

  • Newbie
  • *
  • Posts: 23
    • View Profile
Problem sending a request
« on: September 27, 2009, 11:13:56 pm »
Hello, I'm trying to send a request using the HTTP part of the network package, but I get a linker error. I'm linking sfml-network.lib in my project. Has anyone else had this problem and does anyone know a fix for it?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Problem sending a request
« Reply #1 on: September 27, 2009, 11:28:21 pm »
Maybe if you give us the error..  :roll:
SFML / OS X developer

Austech

  • Newbie
  • *
  • Posts: 23
    • View Profile
Problem sending a request
« Reply #2 on: September 28, 2009, 01:16:38 am »
Oh, sorry about that. The error is:

1>Main.obj : error LNK2001: unresolved external symbol "public: class sf::Http::Response __thiscall sf::Http::SendRequest(class sf::Http::Request const &,float)" (?SendRequest@Http@sf@@QAE?AVResponse@12@ABVRequest@12@M@Z)

Code: [Select]
#include <iostream>
#include <SFML/Network.hpp>

int main(int argc[],char *argv[])
{
sf::Http::Request Request;
Request.SetMethod(sf::Http::Request::Post);
    Request.SetURI("/");
    Request.SetBody("");
    Request.SetHttpVersion(1, 0);
Request.SetField("pageUserId","682635");
Request.SetField("commentTitle","hi");
Request.SetField("commentContent","whatsup");
Request.SetField("SecCode","");

sf::Http Http;
Http.SetHost("www.blogtv.com");
Http.SendRequest(Request);

return 0;
}

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Problem sending a request
« Reply #3 on: September 28, 2009, 10:19:39 am »
maybe you forget SFML_DYNAMIC ( see http://www.sfml-dev.org/tutorials/1.5/start-vc.php ) if you're using the dynamic libs.
SFML / OS X developer