1

I am new to the D programming language, and would like to use ncurses in D. I have found a good D port of ncurses, but I want to be able to import it in any source file without writing:

gdc <files> ncurses.d

Is there any way I can make it included every time?

Btw I am using gdc on debian Gnu/Linux.

1 Answers1

4

No. You should consider using a build tool, such as rdmd, which will automatically construct a compiler's command line and add all modules included by your program.

If, for some reason, you don't want to use a build tool, a common approach is to use a Makefile.

Vladimir Panteleev
  • 24,651
  • 6
  • 70
  • 114
  • 1
    Well, you could put it in with the phobos folder. dmd2/src/phobos (relative to the zip layout) is in the default include path - that's where it fetches std, and you could put other things there. But note you might have to be careful about linking it anyway so the benefit may not be sigificant anyway. – Adam D. Ruppe Jan 31 '14 at 02:16
  • 3
    Or you could change your dmd.conf to add another include path too. But again, this doesn't *compile* in the modules automatically like rdmd, it just finds them for importing the symbol list. – Adam D. Ruppe Jan 31 '14 at 02:47
  • Technically speaking, you *can* add files to compile to your dmd.conf, but that's a rather crude hack and will likely break compiling unrelated programs. – Vladimir Panteleev Jan 31 '14 at 06:57
  • I think that the Makefile is still the best option @CyberShadow – Cedric Morent Jan 31 '14 at 09:51
  • 1
    @CedricMorent Best option would be setting it up with dub. It's usually pretty easy to create a dub package if it doesn't already exist. – Cubic Jan 31 '14 at 12:28