#pragma comment (lib, ...)

Jacob Carlborg doob at me.com
Wed Oct 10 23:46:49 PDT 2012


On 2012-10-11 04:54, Jesse Phillips wrote:

> I don't see why, I'm the programmer I'd have to tell the package manager
> what version I'm using... and again I don't know what it is. I'd think
> pragma(lib) + package manager would get along nicely.

You don't know what version of a library you're using? That sounds 
pretty bad. Sure you might not need to know which version of a system 
library you're using but you should really know the version of all third 
party libraries you're using. Otherwise there's a huge risk of things 
starting to break.

What about any other compile or link flags, do you keep them in a 
separate file? Why would you keep half of the flags in one file and the 
other half in another file?

> "Hi there, I need this library." says the source file.
>
> "Hmm, ok, let me get this version as I've been instructed to do so."
> replies the PM.
>
> "Hey, what about me... lib..." says a close friend.
>
> "Yeah, yeah, let me see... how does the latest version sound/what is
> installed? I don't know what you need but we can give this a try." sadly
> replies the PM.

So it just picks a random version, that doesn't sound like very good 
behavior.

> "Mister programmer man, you have unspecified library versions for...
> What do would you like to do with them? Did the currently selected
> version work out for you?" The PM tells the programmer.

So this is just a guessing game, trail and error?

I think it would be much better to work with packages and not individual 
libraries. You would just tell the build tool, compiler or whatever to 
use package "foo". Then the package manager figures out what libraries 
and dependencies it needs to link to and also the path to the import files.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list