gcc linkage problem with C & D

Charles D Hixson charleshixsn at earthlink.net
Thu Jul 26 03:08:08 PDT 2007

Frits van Bommel wrote:
> Charles D Hixson wrote:
>> a bust.  But this means that I'm going to need to pass into the linker 
>> the output of `pkg-config --libs gtk+-2.0`, which doesn't appear to 
>> pass correctly to dmd. (I can't even see any compiler options for 
>> accepting it...you'd think that -L might work, but if it will I 
>> haven't out how to cause it to.)
> Two options:
> 1) Pass "-L$(DMD_DIR)/lib -lphobos -lpthread -lm" to gcc or ld when 
> using either for linking (these are the libs D requires when compiled 
> with dmd, IIRC).
> 2) Pass something like $(addprefix -L, $(shell pkg-config --libs 
> gtk+-2.0)) to dmd when using it for linking. This will add '-L' in front 
> of every library specification; the reason just adding -L didn't work 
> was that your command adds multiple libraries.

Thanks much.  That should enable me to build.
(I still can't figure out why gcc won't link...unless that's 
your first answer.  Haven't yet tried this, and won't tonight, 
as it's early in the morning.)

More information about the Digitalmars-d-learn mailing list