Skip to content

importc: cannot use forward declaration of static function when building a library #22153

Description

@rainers

While trying to build phobos as a library with a single call, dmd errors out with

error : no definition found for static `deflate_stored` in this module, statics defined in one module cannot be referenced from another

This boils down to compiling this C code with -lib:

static void static_fun();

void lib_fun()
{
	static_fun();
}

static void static_fun()
{
}

yields:

Error: no definition found for static `static_fun` in this module, statics defined in one module cannot be referenced from another

Also note the missing file and line number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions