本文介绍了C ++ REST API错误:链接器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们



你能帮忙解决这个与C ++ REST API有关的错误



我写了一个小代码。



Hi friends

can you help to resolve this error which is related to C++ REST API

I have written a small code .

 <br />
#include "stdafx.h"<br />
#include <cpprest/http_client.h><br />
#include <cpprest/filestream.h><br />
#include <cpprest/json.h>                       // JSON library<br />
#include <cpprest/uri.h>                        // URI library<br />
#include <cpprest/http_msg.h><br />
<br />
using namespace web;<br />
using namespace web::http;<br />
using namespace web::http::client;<br />
using namespace utility;                    // Common utilities like string conversions<br />
//using namespace concurrency;<br />
using namespace std;<br />
using namespace pplx; <br />
<br />
int _tmain(int argc, _TCHAR* argv[])<br />
{<br />
<br />
	  http_client client(U("https://127.0.0.1:13581"));<br />
<br />
	  // Build request URI and start the request.<br />
	  uri_builder builder(U("/abcd/version"));<br />
<br />
	 auto a = client.request(methods::GET);<br />
	<br />
	return 0;<br />
<br />
}<br />





似乎缺少库文件。我找不到哪个lib文件



错误信息



错误LNK2001:未解析的外部符号__declspec(dllimport)public:class Concurrency :: task< class> __thiscall web :: http :: client :: http_client :: request(class web :: http :: http_request,class Concurrency :: cancellation_token const&)( __imp_?request @ http_client @ client @ http @ web @@ QAE?AV?$ task @ Vhttp_response @ http @ web @@@ Concurrency @@ Vhttp_request @ 34 @ ABVcancellation_token @ 6 @@ Z)



it seems there is library file is missing . I couldn't find which lib file is that

Error Message

error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Concurrency::task<class> __thiscall web::http::client::http_client::request(class web::http::http_request,class Concurrency::cancellation_token const &)" (__imp_?request@http_client@client@http@web@@QAE?AV?$task@Vhttp_response@http@web@@@Concurrency@@Vhttp_request@34@ABVcancellation_token@6@@Z)

推荐答案



这篇关于C ++ REST API错误:链接器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 20:14