Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pablo-msft opened this issue Mar 21, 2024 · 0 comments
Open

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

pablo-msft opened this issue Mar 21, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@pablo-msft
Copy link

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.

@pablo-msft pablo-msft added the bug Something isn't working label Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants