Thread overview
[Issue 22537] importC: Error: undefined reference to 'function' when using static in forward declaration
Nov 23, 2021
Iain Buclaw
Nov 23, 2021
Iain Buclaw
Dec 02, 2021
Walter Bright
Dec 10, 2021
Walter Bright
Dec 10, 2021
Walter Bright
Apr 08, 2022
Andrea Fontana
Apr 21, 2022
duser@neet.fi
Sep 21, 2022
Walter Bright
Sep 21, 2022
Walter Bright
November 23, 2021
https://issues.dlang.org/show_bug.cgi?id=22537

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Looking at the output of nm, you can see the function appears twice.

0000000000000000 t func
                 U func
0000000000000000 W main

--
November 23, 2021
https://issues.dlang.org/show_bug.cgi?id=22537

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ImportC, wrong-code

--
December 02, 2021
https://issues.dlang.org/show_bug.cgi?id=22537

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=22538

--
December 10, 2021
https://issues.dlang.org/show_bug.cgi?id=22537

--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> ---
Fixed by https://github.com/dlang/dmd/pull/13399

--
December 10, 2021
https://issues.dlang.org/show_bug.cgi?id=22537

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
April 08, 2022
https://issues.dlang.org/show_bug.cgi?id=22537

Andrea Fontana <trikkuz@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |trikkuz@gmail.com
         Resolution|FIXED                       |---

--- Comment #3 from Andrea Fontana <trikkuz@gmail.com> ---
The same code using -lib won't work:

dmd file.c -lib

Error: no definition for static func

--
April 21, 2022
https://issues.dlang.org/show_bug.cgi?id=22537

duser@neet.fi changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |duser@neet.fi

--- Comment #4 from duser@neet.fi ---
it works with -lib on stable v2.099.1 but not current git master

bisected it to https://github.com/dlang/dmd/pull/13846

--
September 21, 2022
https://issues.dlang.org/show_bug.cgi?id=22537

--- Comment #5 from Walter Bright <bugzilla@digitalmars.com> ---
Please don't reopen fixed bugs with different bugs. It makes the bug list unnecessarily hard to manage.

--
September 21, 2022
https://issues.dlang.org/show_bug.cgi?id=22537

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Walter Bright <bugzilla@digitalmars.com> ---
Closed and filed new issue https://issues.dlang.org/show_bug.cgi?id=23356

--