Undefined function, even though imported

Jonathan M Davis jmdavisProg at gmx.com
Mon Jun 13 14:51:54 PDT 2011


On 2011-06-13 14:44, Loopback wrote:
> Thanks for your answer!
> 
> Seems like supplying with the file location solved the problem, though I
> still wonder about one thing. The imported module is located in
> "c:/d/dmd2/import/win32/windef.d" and I have used this command line to
> the DMD compiler: -I"c:/d/dmd2/import/". Shouldn't the linker/compiler
> be able to solve this on its own then?

-I just tells it where to look for imports, not what to link. The linker never 
links in anything unless you explicitly tell it to - either by having it 
directly on the command line or in DFLAGS (usually set by dmd.conf on Linux 
and sc.ini or Windows). Phobos is listed in dmd.conf/sc.ini, which is why it 
gets linked in. If it wasn't there, you'd have to list it explicitly too.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list