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

Windows CMake VS build fails in vendor/icu #2961

Open
clinthidinger opened this issue Oct 23, 2024 · 6 comments
Open

Windows CMake VS build fails in vendor/icu #2961

clinthidinger opened this issue Oct 23, 2024 · 6 comments
Labels
bug Something isn't working build Related to build, configuration or CI/CD windows

Comments

@clinthidinger
Copy link

Describe the bug
Windows CMake build with Visual Studio fails with unresolved external symbol errors for UnicodeString:

`Building Custom Rule C:/Users/xxx/Documents/code/maplibre-native/CMakeLists.txt
mbgl-vendor-icu.lib(uinvchar.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: int __cdecl icu_61::UnicodeString::length(void)const " (__imp_?l
ength@UnicodeString@icu_61@@QEBAHXZ) referenced in function uprv_isInvariantUnicodeString [C:\Users\xxx\maplibre-native\
build\bin\mbgl-cache.vcxproj]
mbgl-vendor-icu.lib(uinvchar.obj) : error LNK2019: unresolved external symbol "__declspec(dllimport) public: char16_t const * __cdecl icu_61::UnicodeString::getBuffer(void)c
onst " (__imp_?getBuffer@UnicodeString@icu_61@@QEBAPEB_SXZ) referenced in function uprv_isInvariantUnicodeString [C:\Users\xxx\maplibre-native\build\bin\mbgl-cache.vcxproj]
C:\Users\xxx\Documents\code\maplibre-native\build\bin\Release\mbgl-cache.exe : fatal error LNK1120: 2 unresolved externals [C:\Users\xxx\Documents\code\maplibre-native\build\bin\mbgl-cache.vcxproj]`

To Reproduce
Steps to reproduce the behavior:

  1. Run Cmake on windows for the project
  2. cmake --build . --config Release

Expected behavior
A successful build.

Explanation
UnicodeString::length() is defined here: https://github.com/maplibre/maplibre-native/blob/main/vendor/icu/include/unicode/unistr.h#L3906

unistr.h is being included in univchar.h here: https://github.com/maplibre/maplibre-native/blob/main/vendor/icu/src/uinvchar.h#L27

I have not looked into a proper fix.

I hacked the problem by commenting out uprv_isInvariantUnicodeString() in maplibre-native/vendor/icu/src/uinvchar.h since it is not used. It successfully built after I did that.

Platform information (please complete the following information):

  • OS: Windows 11 Win64
  • Platform GLFW
  • Version c098a12

MBGL_USE_BUILTIN_ICU was not explicitly set.

@clinthidinger clinthidinger added the bug Something isn't working label Oct 23, 2024
@louwers louwers added windows build Related to build, configuration or CI/CD labels Oct 23, 2024
@louwers
Copy link
Collaborator

louwers commented Oct 23, 2024

Maybe @tdcosta100 knows how to resolve this

@tdcosta100
Copy link
Collaborator

I need to check the vcpkg repository. I updated it some days ago, but it was reversed by someone by mistake. Could you go to vcpkg directory:

cd platform\windows\vendor\vcpkg

And then do the commands:

git fetch --all
git checkout 2024.09.30

Then try to build again. If it works, the problem is the vcpkg version.

@clinthidinger
Copy link
Author

MINGW64 ~/Documents/code/maplibre_test/maplibre-native/platform/windows/vendor/vcpkg (main)
$ git checkout 2024.09.30
error: pathspec '2024.09.30' did not match any file(s) known to git

I did the fetch. Am I missing a step?

@tdcosta100
Copy link
Collaborator

No, my instruction was wrong, sorry. Please try again with this:

git checkout tags/2024.09.30

@louwers
Copy link
Collaborator

louwers commented Oct 25, 2024

Should be fixed in main now: #2966

@tdcosta100
Copy link
Collaborator

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build Related to build, configuration or CI/CD windows
Projects
None yet
Development

No branches or pull requests

3 participants