0

I am sure this is a very simple fix but I cannot find the answer using google/SO. I have a C++ program that works and compiles flawlessly with MSVC 2019 but as part of my dev-ops, want to use cl.exe to compile. After much debugging, I have found stringstream to be the offender but I am not sure what lib I am missing that is causing the error.

Update: I have found this thread naming a workaround although they did not figure out the option. Would still like anyones input that could solve it.

which library contains _is_c_termination_complete

Here are the libs I am currently using:

 Kernel32.lib Ole32.lib OleAut32.lib ucrt.lib libvcruntime.lib libcmt.lib libcpmt.lib

Here is the error:

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
Bin\\test.dll : fatal error LNK1120: 6 unresolved externals

Any ideas are welcome. Thank you

whyohwhy
  • 1
  • 1
  • 3
    From the diagnostic you are showing: "_Specify /EHsc_". https://learn.microsoft.com/en-us/cpp/build/reference/eh-exception-handling-model?view=msvc-170#standard-c-exception-handling – user17732522 Aug 26 '22 at 23:26
  • As @user17732522 points out you are trying to use code that relies on specific exception handling. So you must specify the appropriate compiler flag `/EHsc` which enables `Full compiler support for the Standard C++ exception handling mode` – jpr42 Aug 27 '22 at 00:09
  • Thanks everyone, updated to the actual error. /EHsc was needed as left in debugging code by accident – whyohwhy Aug 27 '22 at 03:25
  • If you've already got a working visual studio project why don't you just copy the command lines that it's using? Otherwise please show a [mre] including the code and command lines that you're using – Alan Birtles Aug 27 '22 at 07:05

0 Answers0