Compile fails, don't know why

Mike Parker via Digitalmars-d digitalmars-d at puremagic.com
Fri Mar 18 09:41:08 PDT 2016


On Friday, 18 March 2016 at 10:38:00 UTC, Nafees wrote:

> Now I created a folder in the usr/include/dmd named qlib and 
> placed the module there, yet it won't work.

You have a fundamental misunderstanding here. Imported modules 
are not automatically compiled when you add them to the import 
path with -I. Imported modules still need to be compiled and 
linked into the program. You can do this in one of three ways:

1) Pass the imported module on the command line as advised above. 
In that case, it doesn't need to be on the import path with -I, 
since the compiler already has the relevant module on the command 
line.
2) Compile the module separately and pass the compiled object on 
the command line with the other source. In that case you still 
need to use -I to tell the compiler where to look for imported 
symbols.
3) Compile the module separately and add it with one or more 
objects to a static library. Still need -I here.

-I is just so the compiler knows where to look for imported 
modules so that it knows which symbols are available. It does not 
cause those modules to be compiled.


More information about the Digitalmars-d mailing list