0

I am trying to compile a program in MSVC 2019 but I keep getting the following error and searching through google and SO has not lead to an answer. This is my first question so I am not sure what other detail to provide. The project itself is quite large and this seems to be a dependancy issue as opposed to code issue (I hope) so I have not included it here as not sure how relevant is it is. Can let you know what headers I am using if people thinks it helps?

Error compiling using cl64.exe:

        C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\ostream(534): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
        C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\ostream(527): note: while compiling class template member function 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::write(const _Elem *,std::streamsize)'
    with
    [
        _Elem=char
    ]
        C:\Users\User\Desktop\test.h(72): note: see reference to function template instantiation 'std::basic_ostream<char,std::char_traits<char>> &std::basic_ostream<char,std::char_traits<char>>::write(const _Elem *,std::streamsize)' being compiled
    with
    [
        _Elem=char
    ]

         C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\istream(711): note: see reference to class template instantiation 'std::basic_ostream<char,std::char_traits<char>>' being compiled
         C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29910\include\sstream(515): note: see reference to class template instantiation 'std::basic_iostream<char,std::char_traits<char>>' being compiled
         C:\Users\User\Desktop\test.h(66): note: see reference to class template instantiation 'std::basic_stringstream<char,std::char_traits<char>,std::allocator<char>>' being compiled
         libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol _is_c_termination_complete referenced in function __scrt_dllmain_uninitialize_c
         libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_initialize referenced in function __scrt_initialize_crt
         libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_uninitialize referenced in function __scrt_uninitialize_crt
         libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_uninitialize_critical referenced in function __scrt_dllmain_uninitialize_critical
         libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_thread_attach referenced in function __scrt_dllmain_crt_thread_attach
         libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __acrt_thread_detach referenced in function __scrt_dllmain_crt_thread_detach

Error compiling within MSVC:

 Error  LNK2019 unresolved external symbol     URLOpenBlockingStreamA referenced in function "class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl downloadResource(char *)" (?downloadResource@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAD@Z)   test    C:\Users\User\Desktop\test.obj
  • For the linking error it tells you the required library `Urlmon.lib` in the msdn help page for `URLOpenBlockingStreamA`: [https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms775127(v=vs.85)](https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/ms775127(v=vs.85)) – drescherjm Aug 24 '22 at 00:14
  • 1
    I don't know much, but I'm certain this can't be answered based on the information provided. – Captain Giraffe Aug 24 '22 at 00:19
  • Welcome to Stack Overflow. Please read the [About](http://stackoverflow.com/tour) page soon and also visit the links describing [How to Ask a Question](http://stackoverflow.com/questions/how-to-ask) and [How to create a Minimal Reproducable Example](https://stackoverflow.com/help/minimal-reproducible-example). Providing the necessary details, including your MRE, compiler warnings and associated errors, and sample data if any, will allow everyone here to help you with your question. – David C. Rankin Aug 24 '22 at 02:14

0 Answers0