Thread overview
import from the same dir
Nov 26, 2007
Alexandr
Nov 26, 2007
Daniel Keep
Nov 26, 2007
bearophile
November 26, 2007
hello to all!
i have:
======systemsolver.d====
module systemsolver;
import std.stdio;
class SystemSolver
{
  this()
  {
    writefln("Constr!");
  }
}

===main.d==
import std.stdio;
import systemsolver;

void main(char[][] args)
{
  writefln("Hello World, Reloaded");
}
=====
these 2 files are in the same dir. When i try to compile main.d i get error:
user@LMZ:/Coding$ dmd main.d
gcc main.o -o main -m32 -Xlinker -L/home/user/dmd/bin/../lib -lphobos -lpthread -lm
main.o:(.data+0x38): undefined reference to `_D12systemsolver12__ModuleInfoZ'
collect2: ld returned 1 exit status
--- errorlevel 1
======
help me please!

November 26, 2007

Alexandr wrote:
> ...
> these 2 files are in the same dir. When i try to compile main.d i get error:
> user@LMZ:/Coding$ dmd main.d

You need to use:

$ dmd main systemsolver

DMD will only compile the files you *tell* it to compile.

	-- Daniel
November 26, 2007
Alexandr Wrote:

> these 2 files are in the same dir. When i try to compile main.d i get error:
> user@LMZ:/Coding$ dmd main.d
> gcc main.o -o main -m32 -Xlinker -L/home/user/dmd/bin/../lib -lphobos -lpthread -lm
> main.o:(.data+0x38): undefined reference to `_D12systemsolver12__ModuleInfoZ'
> collect2: ld returned 1 exit status
> --- errorlevel 1
> ======
> help me please!

It's a silly limitation of DMD I hope to see solved soon. In the meantime this limitation can be written in the FAQ to warn newbies, and there are a couple of tools (I use one called "bud") that can solve that problem.

Bye,
bearophile