| Thread overview | |||||
|---|---|---|---|---|---|
|
September 04, 2011 Public imports with D interface files? | ||||
|---|---|---|---|---|
| ||||
I'm compiling a very simple D interface file:
module std_ext.typetuple;
public import std.typetuple
class TypeArray(T...)
{
}
Compiling it as such:
dmd -debug -unittest -D -Dddocs -w -H -o- std_ext/typetuple.d
And including it as such:
import std_ext.typetuple;
void main()
{
TypeArray!(int, double) blah;
}
I get a linker error "Symbol Undefined _D7std_ext9typetuple12__ModuleInfoZ"
Removing the public import removes this error. How can I fix this?
| ||||
September 04, 2011 Re: Public imports with D interface files? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Sean Eskapp | Are you specifying std_ext/typetuple.di or whatever it is called when compiling the main module? The public import probably triggers creation of a module constructor as it really creates aliases for the symbols from the imported module.
David
On 9/4/11 3:17 AM, Sean Eskapp wrote:
> I'm compiling a very simple D interface file:
>
> module std_ext.typetuple;
>
> public import std.typetuple
>
> class TypeArray(T...)
> {
> }
>
> Compiling it as such:
> dmd -debug -unittest -D -Dddocs -w -H -o- std_ext/typetuple.d
>
> And including it as such:
>
> import std_ext.typetuple;
>
> void main()
> {
> TypeArray!(int, double) blah;
> }
>
> I get a linker error "Symbol Undefined _D7std_ext9typetuple12__ModuleInfoZ"
>
> Removing the public import removes this error. How can I fix this?
| |||
September 04, 2011 Re: Public imports with D interface files? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to David Nadlinger | I wasn't including it on the command line; I thought I didn't need to. That fixed it, thanks!
== Quote from David Nadlinger (see@klickverbot.at)'s article
> Are you specifying std_ext/typetuple.di or whatever it is called when
> compiling the main module? The public import probably triggers creation
> of a module constructor as it really creates aliases for the symbols
> from the imported module.
> David
> On 9/4/11 3:17 AM, Sean Eskapp wrote:
> > I'm compiling a very simple D interface file:
> >
> > module std_ext.typetuple;
> >
> > public import std.typetuple
> >
> > class TypeArray(T...)
> > {
> > }
> >
> > Compiling it as such:
> > dmd -debug -unittest -D -Dddocs -w -H -o- std_ext/typetuple.d
> >
> > And including it as such:
> >
> > import std_ext.typetuple;
> >
> > void main()
> > {
> > TypeArray!(int, double) blah;
> > }
> >
> > I get a linker error "Symbol Undefined _D7std_ext9typetuple12__ModuleInfoZ"
> >
> > Removing the public import removes this error. How can I fix this?
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply