Strategy to link/include library

o3o orfeo.davia at gmail.com
Wed Jan 16 07:08:11 PST 2013


On Wednesday, 16 January 2013 at 12:00:54 UTC, Jacob Carlborg 
wrote:

Thanks for your prompt response.

> [cut]
> You usually place it in a common directory. You then use the -I 
> switch to make the compiler aware of this directory.
Let me play with some scenario: I've a library 'acme' release 1.0 
and two client C1 and C2.

* scenario 1: acme in common directory
+ acme
   ...
+ C1
   ...
+ C2
   ...

So, in C1
$dms -I../acme *.d

and in C2
$dms -I../acme *.d

suppose that C2 need a new feature from acme library, so I modify 
and
recompile acme sources and I get the new acme rel. 2.0.
But C1 still uses the old release 1.0, and if I recompile C1 it 
is linked to new new acme rel. 2.0...

* scenario 2: acme in subdirectory
If I include acme as subdirectory like this:

+ C1
   ...
   + acme
+ C2
   ...
   + acme

I resolve the problem on scenario 1. (C1 uses rel. 1.0 and C2 
rel. 2.0) but if I fix a bug in acme, I should update C1, C2 and 
all other clients that use acme.

What do you think? what is your way of working?


> Ideally this should be handled by a package manager and a build 
> tool.
which package manager do you suggest? (of course orbit :) ), and 
which build tool (I use rake)?

Thank you very much



More information about the Digitalmars-d-learn mailing list