Import function from module

Hasan Aljudy hasan.aljudy at gmail.com
Sat Oct 14 23:09:47 PDT 2006



LW wrote:
> How do I use a function from another module in my main file without
> generating a library-file or using the second file as a parameter for
> dmd.exe?
> 

Technically speaking, that's not possible.

But in reality, you can use the "dbuild" tool, which will hide these 
details from you; it reads import statements and figures out module 
dependencies.
Just pass it the module (file) that contains the main function, and use 
the -clean switch to delete .obj files after the build.

http://www.dsource.org/projects/build

(p.s. it's actually called "build", not "dbuild"; at least not 
officially yet)



More information about the Digitalmars-d-learn mailing list