在 2022/10/11 00:39, Xavier Claessens via Gcc 写道: > > Is there a trick to get that working with GCC? Or should that issue be > reported somewhere? > Probably. This Microsoft `dllimport` with `inline` has the same semantics with GNU `extern inline`, so may be it's an alternative. So instead of ``` GLIB_API inline int g_strcmp0(const char*, const char*) { ... ``` you may try ``` __attribute__((__gnu_inline__)) extern inline int g_strcmp0(const char*, const char*) { ... ``` In contrast to C, you don't need the `extern` in C++. When this function is being defined in a DLL, `__dllexport__` should be used in place of `__gnu_inline__`. This may require another macro, similar to `GLIB_API`. -- Best regards, LIU Hao