Thread overview | |||||
---|---|---|---|---|---|
|
November 26, 2007 import from the same dir | ||||
---|---|---|---|---|
| ||||
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 Re: import from the same dir | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alexandr |
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 Re: import from the same dir | ||||
---|---|---|---|---|
| ||||
Posted in reply to Alexandr | 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
|
Copyright © 1999-2021 by the D Language Foundation