How to use the -I command line switch?
Ali Çehreli
acehreli at yahoo.com
Wed Jan 3 18:35:21 UTC 2018
On 01/03/2018 09:10 AM, tipdbmp wrote:
>> dmd main.d C:\libs\my_module.d
> That does not use the -I switch.
>
> It compiles if I specify the full path to my_module.d:
> dmd -IC:\libs main.d C:\libs\my_module.d
>
> I don't understand the error message though.
>
-I is for import directives only. imports are needed to compile the
importing module. All other modules still need to be compiled themselves
and added to the program either as individual .o files or as libraries
(e.g. .a, .lib, etc.).
The method you've shown is a shorthand for "compile each to .o and add
each to the program."
Working as expected... :)
Ali
More information about the Digitalmars-d-learn
mailing list