ICU 78.1: C4275 in GregorianCalendar and NumberFormat

6 views
Skip to first unread message

Christian Maurer

unread,
Nov 26, 2025, 7:53:51 AMNov 26
to icu-support
Hi all!

In ICU 78.1 I get the warning "C4275: non dll-interface class 'icu_78::Calendar' used as base for dll-interface class 'icu_78::GregorianCalendar'.

Im am building with 'Microsoft (R) C/C++ Optimizing Compiler Version 19.44.35221 for x64' using the options:
/std:c++20 /EHsc /W3

Testcase:
#include <iostream>
#include <unicode/gregocal.h>

int main(int argc, char *argv[])
{
    UErrorCode status = U_ZERO_ERROR;
    icu::GregorianCalendar cal(status);

    if (U_FAILURE(status)) {
        std::cerr << "Error creating GregorianCalendar\n";
        return 1;
    }

    return 0;
}


Relevant output:
ICU\78.1\include\unicode/gregocal.h(153): warning C4275: non dll-interface class 'icu_78::Calendar' used as base for dll-interface class 'icu_78::GregorianCalendar'
ICU\78.1\include\unicode/calendar.h(189): note: see declaration of 'icu_78::Calendar'
ICU\78.1\include\unicode/gregocal.h(153): note: see declaration of 'icu_78::GregorianCalendar'



The same happens for NumberFormat / Format:
ICU\78.1\include\unicode/numfmt.h(175): warning C4275: non dll-interface class 'icu_78::Format' used as base for dll-interface class 'icu_78::NumberFormat'
ICU\78.1\include\unicode/format.h(98): note: see declaration of 'icu_78::Format'
ICU\78.1\include\unicode/numfmt.h(175): note: see declaration of 'icu_78::NumberFormat'

In ICU 76.1 there was no such warning.

AFAIK it is not allowed to exclude a base class from the DLL export?

Fredrik Roubert

unread,
Nov 26, 2025, 9:17:38 AMNov 26
to Christian Maurer, icu-support
On Wed, Nov 26, 2025 at 1:53 PM Christian Maurer <c.mau...@gmail.com> wrote:

> In ICU 76.1 there was no such warning.

This is new in ICU 78, it's a side-effect of this change to exclude
private class members from the DLL interface:

https://unicode-org.atlassian.net/browse/ICU-23136

> AFAIK it is not allowed to exclude a base class from the DLL export?

I don't have the faintest idea, but if you're able to figure out what
the warning really means and if there are any changes that ought to be
made to ICU then I'd be most interested to learn about that.

--
Fredrik Roubert
rou...@google.com
Reply all
Reply to author
Forward
0 new messages