Some Basic Question
Sean Kelly
sean at f4.ca
Mon Aug 14 22:11:15 PDT 2006
Jay Kyburz wrote:
> Hi All,
>
> I'm a hobby programmer and have been playing around with D for a few weeks. I
> usually make little games and have recently started a gui project using DWT.
> Not much gets finished but I have fun solving the problems and making stuff
> happen.
>
> In the past I've used a bunch of different scripting languages, quite a bit
> of Basic and Pascal and a bit of C#. Most of these have been presented in a
> neat package where I can simply hit the build button and get an exe.
>
> D is a little different in that you have to know a little more about what is
> going on when you try and build something. Well, perhaps you don't need to
> know it, but because it's exposed I find myself asking questions.
>
> Anyhow, I guess thats my question. Is there somewhere I can go and read about
> the fundamentals of the build process?
It may help to know that D is pretty much the same as C in that source
files are compiled to an intermediate language (ie. object files) and
then linked to produce an executable application.
> Examples: What do each of the exe's in bm/bin do? In what order are they run?
> Why have a dm and a dmd folder.
The dm folder contains the Digital Mars C compiler and linker, which is
used both for linking and also possibly for code generation. I've got a
bunch of stuff in dm/bin so I can't come up with a list of default EXEs
offhand, but 'lib' generates static libraries, 'make' is a make tool,
'link' is a linker, and I think 'sc' is an alias for 'dmc' which is the
C compiler.
> When I import a module, how does the build
> process find my source files.
It looks in your include path, which is in dmd/bin/sc.ini as the -I
portion of the DFLAGS variable.
> What the hell does pragma import do, I've read
> the docs but don't understand how this is different to linking to libs .
> etc...
You shouldn't need to use any pragmas for typical D applications, so
don't worry about them. But they are documented here:
http://www.digitalmars.com/d/pragma.html
> If you guys don't know of anywhere this is already documented, do you think
> this list a good place to ask? Perhaps I could add some of the answers I get
> to the wiki.
This is the best place to ask questions not answered by the wiki.
Sean
More information about the Digitalmars-d-learn
mailing list