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 use gettext in UWP application #16801

Closed
levinli303 opened this issue Mar 20, 2021 · 4 comments · Fixed by #19108
Closed

Cannot use gettext in UWP application #16801

levinli303 opened this issue Mar 20, 2021 · 4 comments · Fixed by #19108
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist

Comments

@levinli303
Copy link
Member

Describe the bug
When I try to use gettext in a UWP application, the application failed to start.

Environment

  • OS: Windows 10 20H2
  • Compiler: VS 2019

To Reproduce
Steps to reproduce the behavior:

  1. ./vcpkg install gettext:x64-uwp
  2. Create a new project, UWP app, C++/CX
  3. #include <intl.h> and use gettext somewhere in code
  4. Build and run

Expected behavior
Should run without any issue.

Failure logs
The target process aborted before activation completed.
The program '[1064] GettextTest.exe' has exited with code -1073741502 (0xc0000142) 'DLL Initialization Failed'.

Additional context
intl-8.dll iconv-2.dll ucrtbased.dll are present in the .exe folder.

@JackBoosY JackBoosY self-assigned this Mar 22, 2021
@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Mar 22, 2021
@JackBoosY
Copy link
Contributor

JackBoosY commented Mar 22, 2021

Confirmed. But maybe the upstream doesn't supoort uwp.

@levinli303
Copy link
Member Author

I tried to use libiconv only and it led to the same error.

@levinli303
Copy link
Member Author

@JackBoosY I tested with the commit before #11776 is merged and it was working.

@JackBoosY JackBoosY added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist and removed category:port-bug The issue is with a library, which is something the port should already support labels Mar 30, 2021
@levinli303
Copy link
Member Author

@JackBoosY

I could see that in libiconv, it used GetModuleFileName to get the path and then used strchr to find the path separator.
GetModuleFileName mapped to GetModuleFileNameW but strchr is ANSI, which caused the failure in DLL initialization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants