weixin_39682673
weixin_39682673
2020-11-30 04:19

error LNK2019: unresolved external symbol "bool __cdecl boost::network::uri::detail::parse

Boost: 1_60_0 cpp_netlib: 0.11.2-finals OS: Windows 10 Compiler: VS 2013 Professional Cmake: 3.4.2 GUI

Having trouble linking. I was able to generate visual studio projects and build cppnetlib-client-connections.lib, cppnetlib-servers-parsers.lib and cppnetlib-uri.lib. I have them linked in my project (project->properties->linker->general->additional library directories (C:\Boost\cpp-netlib-0.11.2-final\cpp-netlib-0.11.2-final\BuildTargets\libs\network\src\Release)). I understand that #define BOOST_NETWORK_NO_LIB is deprecated, it doesn't help for the record.

I get the error below.

A concern, I wasn't able to build cppnetlib-server-parsers (which i understand is what is failing the link) without modifying is_same.hpp line 29, 30 and is_const.hpp line 37 resolving ambiguous symbols by replacing false_type and true_type with boost::false_type and boost::true_type.

include

include

include

include

include

include

...

int NvmeorServiceRun() { Sleep(30000); boost::system::error_code ec;


namespace http = boost::network::http;
namespace uri = boost::network::uri;

http::client client;
http::client::request request("http://10.0.132.4");

} Error 121 error LNK2019: unresolved external symbol "bool __cdecl boost::network::uri::detail::parse(class std::_String_const_iterator > >,class std::_String_const_iterator > >,struct boost::network::uri::detail::uri_parts > > > &)" (?parse@?$_String_const_iterator?$_String_val?$_Simple_types@@@@@?$uri_parts?$_String_const_iterator?$_String_val?$_Simple_types@@@@@@@) referenced in function "private: void __thiscall boost::network::uri::uri::parse(void)" (?parse@) C:\Users\Wesley Hunt\Documents\Visual Studio 2012\Projects\TitanService\NvmeorServiceCpp\NvmeorServiceCpp.obj NvmeorServiceCpp

该提问来源于开源项目:cpp-netlib/cpp-netlib

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

5条回答

  • weixin_39955418 weixin_39955418 4月前

    I have the same issue...

    点赞 评论 复制链接分享
  • weixin_39749243 weixin_39749243 4月前

    This is one of those MSVC specific things that need to be added to the declaration/implementation of that function boost::network::uri::detail::parse(...) that someone hasn't contributed yet. Something about making MSVC export that declaration.

    I don't have access to MSVC, but I'm happy to review patches for conditionally adding that annotation/declaration.

    点赞 评论 复制链接分享
  • weixin_39764379 weixin_39764379 4月前

    I got the same error with cpp-netlib-0.11.2, boost 1.60, and VS 15 Update 2.

    点赞 评论 复制链接分享
  • weixin_39749243 weixin_39749243 4月前

    I think I missed a crucial point here -- 0.11.2 doesn't come by default built in C++11 mode. Can you try building the library in C++11 mode?

    点赞 评论 复制链接分享
  • weixin_39764379 weixin_39764379 4月前

    Thanks for replying.

    When it comes to VisualC++, I had it in my head that I don't need to do anything (like supplying-std=c++11) to enable C++11.

    Still, building the libraries didn't give me any error. Referencing them did.

    Thanks.

    点赞 评论 复制链接分享

为你推荐