www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - undefined reference to `_D5xxxx6yyyyy12__ModuleInfoZ'

reply "bioinfornatics" <bioinfornatics fedoraproject.org> writes:
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
Nov 05 2014
next sibling parent Justin Whear <justin economicmodeling.com> writes:
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.
Nov 05 2014
prev sibling parent reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 11/05/2014 03:48 PM, 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
Include all files no the command line: $ dmd -I./src/ ./fasta.d ./src/nicea/metadata.d ./src/nicea/parser.d ./src/nicea/range.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
Ali
Nov 05 2014
parent "bioinfornatics" <bioinfornatics fedoraproject.org> writes:
On Wednesday, 5 November 2014 at 23:53:57 UTC, Ali Çehreli wrote:
 On 11/05/2014 03:48 PM, 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
Include all files no the command line: $ dmd -I./src/ ./fasta.d ./src/nicea/metadata.d ./src/nicea/parser.d ./src/nicea/range.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
Ali
Oh yes , … I need to sleep thanks a lot guys
Nov 05 2014