HttpRequest test won't work?

I’m trying to download a text file. But I do not get the example of “HttpRequest” to work.

HttpRequest* request = new HttpRequest();
request->setUrl("http://www.httpbin.org/get");
request->setRequestType(HttpRequest::Type::GET);
request->setResponseCallback( CC_CALLBACK_2(HelloWorld::onHttpRequestCompleted, this) );
request->setTag("GET test1");
HttpClient::getInstance()->send(request);
request->release();

Error on row:
HttpClient::getInstance()->send(request);

Multiple markers at this line
- undefined reference to ‘cocos2d::network::HttpClient::getInstance()’
- undefined reference to
‘cocos2d::network::HttpClient::send(cocos2d::network::HttpRequest*)’

But I have declared:

#include "network/HttpClient.h"
using namespace cocos2d::network;

Weird… Please include exactly which version/commit you are using. The latest is working for me, and my code is identical to yours.

The only difference is that I use:

#include "cocos2d/cocos/network/HttpClient.h"

to include the files.

Your error is a linker error, which means the file cocos/network/HttpClient.cpp is not being compiled and/or linked in, or the library that it’s part of is not being linked in.

What platform are you building for?

i have the same error im currently building in vc++ windows. Even i added the libnetwork proj to my solution and also added libnetwork to properties->linker->addexternaldependencies
still error persist

fixed by adding libcurl_imp.lib in linker->input->additionallib

Same problem I face with android, hope you have solution for it .