undefined reference to `_D5xxxx6yyyyy12__ModuleInfoZ'

Justin Whear via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Nov 5 15:53:56 PST 2014


On Wed, 05 Nov 2014 23:48:21 +0000, bioinfornatics wrote:

> Dear,
> 
> maybe I'm too tired to see my errors or they are a bug. See below
> 
> I have this:
> .
> |-- fasta.d `-- src
>       `-- nicea
>           |-- metadata.d |-- parser.d `-- range.d
> 
> when I try to build it:
> 
> $ dmd -I./src/  ./fasta.d 2>&1 fasta.o:(.rodata+0x1f8): undefined
> reference to `_D5nicea6parser12__ModuleInfoZ'
> collect2: error: ld returned 1 exit status --- errorlevel 1
> 
> If I merge all files in one that build!
> 
> What is it ?
> 
> I tried to minimize the problem with dustmite but it give to me at end
> an empty file …
> 
> thanks

You have dmd only building the fasta.d file and the linker doesn't know 
where
to find the other objects.  If you've compiled the contents of nicea to a
static library (.a) with -lib, then you need to link that library by 
tacking a
`-Llibnicea.a` onto your compilation command.


More information about the Digitalmars-d-learn mailing list