Jump to content
Sign in to follow this  
mapkoc

[Resolved] icu 61

Recommended Posts

I had to add             using namespace icu;

to             source/lib/external_libraries/icu.h

with icu 61 or else class Locale is not found.

I hate icu, each update breaks everything

Share this post


Link to post
Share on other sites
2 hours ago, mapkoc said:

I had to add             using namespace icu;

to             source/lib/external_libraries/icu.h

with icu 61 or else class Locale is not found.

I hate icu, each update breaks everything

Which OS?

Share this post


Link to post
Share on other sites

Archlinux + all derivatives + Void

I guess the packager always has to recompile because icu always breaks it
but this time they must patch that file.

Maybe icu60 also breaks the compile but i might have skipped that upgrade.

Share this post


Link to post
Share on other sites

@AudaciousTUX is also experiencing the issue, but adding the line mentioned above by itself doesn't fix it:

../../../source/i18n/L10n.cpp:517:24: error: expected type-specifier before ?Locale?
Locale* locale = new Locale(Locale::createCanonical(localeCode.c_str()));
 

Share this post


Link to post
Share on other sites
8 minutes ago, elexis said:

@AudaciousTUX is also experiencing the issue, but adding the line mentioned above by itself doesn't fix it:

../../../source/i18n/L10n.cpp:517:24: error: expected type-specifier before ?Locale?
Locale* locale = new Locale(Locale::createCanonical(localeCode.c_str()));
 

 

Screenshot_20180402_224518.png

Share this post


Link to post
Share on other sites

binaries/system/pyrogenesis: error while loading shared libraries: libicui18n.so.60: cannot open shared object file: No such file or directory

 

4 me as well :(

Share this post


Link to post
Share on other sites
On 4/2/2018 at 10:35 AM, elexis said:

@AudaciousTUX is also experiencing the issue, but adding the line mentioned above by itself doesn't fix it:

../../../source/i18n/L10n.cpp:517:24: error: expected type-specifier before ?Locale?
Locale* locale = new Locale(Locale::createCanonical(localeCode.c_str()));
 

It should, that's the error before importing the namespace. His error is unrelated to 0ad

  • Like 1

Share this post


Link to post
Share on other sites
On 3/31/2018 at 7:17 PM, mapkoc said:

I guess the packager always has to recompile because icu always breaks it
but this time they must patch that file.

Uhm, but svn isn't packaged by them and we want users to be able to build with all current icu versions, nay?

Given that adding the "using namespace icu;" line to icu.h doesn't compile on my end with icu 55.0, I think we' might have to use the "icu::" namespace explicitly everywhere. Apparently there's some alternative  https://codereview.chromium.org/171012/show.

This patch changes Locale to icu::Locale and compiles here, but I guess there are more types that need the same change, like DateFormat. Can someone test?

@bb_ didn't you use arch too? Also leaving a ping for @Itms

locale.patch

  • Like 2

Share this post


Link to post
Share on other sites

Considering how commonplace the name "Locale" is, being forced to specify the namespace is certainly a good thing, even though it breaks stuff.

We usually don't write "using namespace foo;", especially in headers, so I think the better fix is what elexis proposes.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
3 hours ago, Itms said:

Considering how commonplace the name "Locale" is, being forced to specify the namespace is certainly a good thing, even though it breaks stuff.

We usually don't write "using namespace foo;", especially in headers, so I think the better fix is what elexis proposes.

I agree, we definitely have to avoid "using namespace ..." (except very rare cases). Especially we have modern IDEs to autocomplete it. The "icu::" would be better, even for the patch reading.

Share this post


Link to post
Share on other sites

The package maintainer for the distro downloads the release candidate, not svn.

https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/0ad

He already fixes this with the following compiler flag

  # http://site.icu-project.org/download/61#TOC-Migration-Issues
  CXXFLAGS+=' -DU_USING_ICU_NAMESPACE=1'

I guess for svn you can change all locales for icu::locale or  maybe you can use conditional includes

#if icu ver(major or minor) > xx

...

#endif

I don't know the syntax

  • Like 1

Share this post


Link to post
Share on other sites

... but having to recompile game each time icu upgrades minor (5 or 10 times per 0ad release) isn't pretty but I guess that's out of your control.

Share this post


Link to post
Share on other sites

Found some more icu types and replaced them.

Please can someone with icu 6.1 try to compile using this patch and see if it succeeds (without adding a "using namespace icu;"  anyhwere) and if it doesn't post the compile log?

locale.patch

  • Thanks 1

Share this post


Link to post
Share on other sites
Guest

If you are using arcanist, you can use “arc patch D1234”. You could also download the raw diff and use the patch tool to apply.

Edited by Guest
Better formatting.

Share this post


Link to post
Share on other sites

ok, found it

patch -p0 < D1436.diff

@elexis: It doesn't work
../../../source/i18n/L10n.h:314:28: error: ‘Locale’ does not name a type; did yo

../../../source/i18n/L10n.cpp:92:28: error: no matching function for call to ‘L10n::ValidateLocale(const icu_61::Locale&) const’

../../../source/i18n/L10n.h:314:7: note:   no known conversion for argument 1 from ‘const icu_61::Locale’ to ‘const int&’

../../../source/i18n/L10n.cpp:101:72: error: no matching function for call to ‘L10n::ValidateLocale(icu_61::Locale) const’

../../../source/i18n/L10n.cpp:99:6: note:   no known conversion for argument 1 from ‘icu_61::Locale’ to ‘const string& {aka const std::__cxx11::basic_string<cha

../../../source/i18n/L10n.cpp:107:6: error: prototype for ‘bool L10n::ValidateLocale(const icu_61::Locale&) const’ does not match any in class ‘L10n’
 bool L10n::ValidateLocale(const icu::Locale& locale) const

../../../source/i18n/L10n.cpp:258:3: error: ‘CheckedArrayByteSink’ was not declared in this scope

../../../source/i18n/L10n.cpp:259:33: error: ‘sink’ was not declared in this scope

../../../source/i18n/L10n.cpp:389:8: error: ‘TimeZone’ does not name a type; did you mean ‘timezone’?

../../../source/i18n/L10n.cpp:392:2: error: ‘Calendar’ was not declared in this scope

../../../source/i18n/L10n.cpp:408:2: error: ‘NumberFormat’ was not declared in this scope

../../../source/i18n/L10n.cpp:545:85: error: ‘DateFormat’ does not name a type; did you mean ‘UDateFormat’?

and many more

Share this post


Link to post
Share on other sites
On 4/8/2018 at 8:43 AM, mapkoc said:

and many more

(and post all of them in case s0600204 doesn't already have icu61 to be able to fix all of occurrences)

Share this post


Link to post
Share on other sites
33 minutes ago, elexis said:

(and post all of them in case s0600204 doesn't already have icu61 to be able to fix all of occurrences)

At revision 21687.

unrelated

../../../source/third_party/encryption/pkcs5_pbkdf2.h:26:10: fatal error: sodium.h: No such file or directory

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...