On Thu, 08 Nov 2012 17:33:29 -0600, Rene Zwanenburg
renezwanenburg@gmail.com wrote:

On Mon, 05 Nov 2012 21:26:39 -0600, 1100110 wrote:

On Mon, 05 Nov 2012 07:23:49 -0600, Rene Zwanenburg
renezwanenburg@gmail.com wrote:

I'm currently working on a smallish application with a web interface,
and vibe.d seems like a good fit for my needs. However, the
application depends on a large C library. Is it possible to instruct
vibe to link to a certain static library when using the 'vibe'
command from the project root? Or should I call rdmd myself?

Rene

If you are using dmd, then a simple <br>pragma(lib, "gtkd");<br> is all that's necessary. But note that gdc completely ignores that.
I have no clue what ldc does.
I usually include a pragma(lib, "whatever") even if I have a build
script.
It makes it easier for (myself or others) to pick it apart and compile
individual sections.
I can vibe, or dmd -Isource -J... whatever and it still links fine.
As an added bonus, It's a nice way to keep the list of external libs
in one place. Self-documenting code and all that.
So... I would do both pragmas and the dflags method mentioned.
-- Using Opera's revolutionary email client: http://www.opera.com/mail/

Thanks for the suggesion! I always assumed pragma(lib) only worked on
windows, not sure why. Probably because the only other compiler I know
supporting it is VC.

IIRC it doesn't work with ldc, but that's not a problem since we're
using dmd exclusively.

I think that ldc wants to support it, and gdc cannot support it.
Either way as long as the compilers implement the specification correctly,
it will just be ignored if they can't use it.

ldc wants a single binary compiler and linker, while gdc can't do this if
it wants to be included into gcc.

I could be wrong though.