From https://issues.dlang.org/show_bug.cgi?id=9816#c19 :
There are some problems with the current implementation.
export void foo() {} // definition => dllexport
export void foo(); // declaration => dllimport
export int a = 0; // definition => dllexport
export int a; // declaration => dllimport // fails because it's actually a definition
export extern int a; // declaration => dllimport
Comment #1 by dlang-bot — 2022-12-10T03:23:22Z
@WalterBright created dlang/dmd pull request #14680 "fix Issue 23545 - export int a; should generate dllexport, not dllimport" fixing this issue:
- fix Issue 23545 - export int a; should generate dllexport, not dllimport
https://github.com/dlang/dmd/pull/14680
Comment #2 by dlang-bot — 2023-02-08T00:27:49Z
dlang/dmd pull request #14680 "fix Issue 23545 - export int a; should generate dllexport, not dllimport" was merged into master:
- ea945fe1843aae88ddc45c82d7218f045a752110 by Walter Bright:
fix Issue 23545 - export int a; should generate dllexport, not dllimport
https://github.com/dlang/dmd/pull/14680