Skip to content

Cannot link win10-lib into C++/WinRt Runtime component #1253

Description

@pablo-msft

Similar to microsoft/cppwinrt#1053

  1. Build zlib, sqlite-uwp, win10-lib
  2. Create a new C++/WinRT Windows Runtime component
    image
  3. Include LogManager.hpp (no need to write any code)
  4. Link zlib.lib, sqlite-uwp.lib, Microsoft.Applications.Telemetry.Windows.native.lib
  5. Build C++/WinRT DLL
  6. 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)

Resolution: https://stackoverflow.com/questions/34939913/mismatch-detected-for-vccorlib-lib-should-be-specified-before-msvcrt-lib-to-lin

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions