Linking to C library [gdc/mac]

John Reimer terminal.node at gmail.com
Sat Jan 13 10:54:37 PST 2007


On Sat, 13 Jan 2007 16:59:19 +0000, Graham MacDonald wrote:

> Johan Granberg wrote:
>> Graham MacDonald wrote:
>> 
>>> I got glfw to link with my app, but I am having different problems with
>>> freetype.  I'm trying to statically link the latest version of freetype
>>> to my app.  I have some bindings I took from the derelict freetype
>>> binding, but have removed the dynamic linking/derelict library code.
>>>
>>> The problem I'm having is that when I finally link my obj files,
>>> libraries & frameworks, I get an undefined symbol:
>>>    __D8freetype2ft12__ModuleInfoZ
>>>
>>> Can someone explain what I'm missing here?  I've linked with:
>>>    gdc obj/*.o -g -o game -lglfw -lfreetype -framework Carbon -framework
>>> OpenGL -framework AGL
>>>
>>> Seems ok to me, but I'm sure I've missed something.
>>>
>>> Thanks in advance
>>>
>>> Graham
>> 
>> Have you compiled the freetype binding and linked the resulting .o file in
>> your app?
> 
> .....that's the one!  I didn't realise I have to compile the binding 
> since I was importing it.
> 
> Thanks!
> 
> graham


You have to link these symbols in because they will be assigned pointers
to the freetype functions at runtime (from the shared library).

If the the static import modules were used, meaning you are linking with a
static lib, then you wouldn't have to link in the module.

-JJR


More information about the D.gnu mailing list