Cannot link win10-lib into C++/WinRt Runtime component
pablo-msft opened this issue · 0 comments
Similar to microsoft/cppwinrt#1053
- Build zlib, sqlite-uwp, win10-lib
- Create a new C++/WinRT Windows Runtime component
- Include LogManager.hpp (no need to write any code)
- Link zlib.lib, sqlite-uwp.lib, Microsoft.Applications.Telemetry.Windows.native.lib
- Build C++/WinRT DLL
- Build errors:
1>vccorlibd.lib(init.obj) : error LNK2038: mismatch detected for 'vccorlib_lib_should_be_specified_before_msvcrt_lib_to_linker': value '1' doesn't match value '0' in MSVCRTD.lib(app_appinit.obj)
1>vccorlibd.lib(init.obj) : error LNK2005: __crtWinrtInitType already defined in MSVCRTD.lib(app_appinit.obj)
Many repetitions of:
1>Microsoft.Applications.Telemetry.Windows.native.lib(capi.obj) : warning LNK4197: export 'DllGetActivationFactory' specified multiple times; using first specification
1>Microsoft.Applications.Telemetry.Windows.native.lib(capi.obj) : warning LNK4197: export 'DllCanUnloadNow' specified multiple times; using first specification
This seems to be due to vccorlib and C++/CX dependencies used in win10-lib. See: https://stackoverflow.com/questions/12893355/windowsstorageapplicationdatacurrent-not-found-in-c
Expected behavior: we ought to be able to link the static cpp_client_telemetry lib into our WinRT DLL without conflicts. Then we can distribute just the WinRT DLL with cpp_client_telemetry built into it.