dgtkd

GtkD (the Gtk+bindings for the D language) why compile it?


I've recently been using GtkD with the D programming language to create native applications. I've downloaded all the necessary files and got everything running so i can now compile and produce sample apps.

My question is that in some of the guides it tells you to compile GtkD on the platform you are using but what is the point? Once compiled you end up with a single lib file on Windows (GtkD.lib) and three lib files on Linux (ending in *.a). What are these files for and how are they used? Like i said everything seems to be working without doing anything with these files.

I'm guessing you can statically link these? but what's that for? To avoid compiling the GtkD source each time? I did actually try that using the pragma('lib', 'GtkD.lib') statement but it didn't seem to do anything.

Can anyone shine any light on this or explain why these files are needed?


Solution

  • source files that are imported aren't compiled, they are only parsed for the symbol names and function signatures (and the templates)

    creating libs is to avoid needing to recompile the entire library each time you need to rebuild and the compiler can then only use the .di files for the imports

    this stems from the olden days where compiling took ages, and now it can be used to keep a library closed source