Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

Issue when updating to Visual Studio 2022: nuget packages are not working anymore, even for raw template projects (C++/winRT)

$
0
0

I recently updated my toolchain to Visual Studio 2022 to benefit from the latest and greatest of Microsoft's developer team.

Since then, my updated projects are struggling finding the headers from the nuget package I'm using (cpprestsdk):

enter image description here

When forcing the include path in the property of the project, the linker returns errors for unresolved external symbols:

1>App.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl utility::conversions::to_utf8string(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (__imp_?to_utf8string@conversions@utility@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@4@@Z) referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl utility::conversions::details::print_utf8string<wchar_t [18]>(wchar_t const (&)[18])" (??$print_utf8string@$$BY0BC@_W@details@conversions@utility@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEAY0BC@$$CB_W@Z)1>App.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl web::uri::uri(wchar_t const *)" (__imp_??0uri@web@@QEAA@PEB_W@Z) referenced in function "public: __cdecl <lambda_b8d78f1b6bbbf9eaa70df1523bc19c68>::operator()(class Concurrency::streams::basic_ostream<unsigned char>)const " (??R<lambda_b8d78f1b6bbbf9eaa70df1523bc19c68>@@QEBA@V?$basic_ostream@E@streams@Concurrency@@@Z)1>App.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl web::uri::uri(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &)" (__imp_??0uri@web@@QEAA@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@@Z) referenced in function "public: class Concurrency::task<class web::http::http_response> __cdecl web::http::client::http_client::request(class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > const &,class Concurrency::cancellation_token const &)" (?request@http_client@client@http@web@@QEAA?AV?$task@Vhttp_response@http@web@@@Concurrency@@AEBV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@0AEBVcancellation_token@6@@Z)...1>C:\Users\arnau\source\repos\BlankAppTest\x64\Debug\BlankAppTest\BlankAppTest.exe : fatal error LNK1120: 26 unresolved externals

I also tried to start with a blank project from a predefined template (C++/winRT) but without success...

I have to confess I'm more focused on writing code than on project settings. I may have overlooked something in the setup process. However, the fact that the default project is not compiling correctly makes me think there's something wrong in my toolchain update.

So for the moment, I'm reverting to Visual Studio 2019...

Any help/pointers/suggestion on how to solve the issue will be greatly appreciated !

Best regards,

Arnaud


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>