Linking to C

Mike Chaten mchaten at gmail.com
Tue Nov 2 18:14:03 PDT 2010


How are you compiling & linking the files? I've gotten this error before
when I forgot to include a file in my compilation (in your case
libraw_c_headers)

On Tue, Nov 2, 2010 at 8:47 PM, scrappylildude <sdl at yahoo.com> wrote:

> Hello,
>
> New to D, but I am loving it so far.
>
> I am having some trouble linking to a C library static library (LibRaw
> 0.10.0).  I ran htod on the LibRaw
> header files, and fixed up the resulting file by hand.
>
> Now when I compile and attempt to link, I get one error:
>
> Undefined symbols:
>  "_D16libraw_c_headers12__ModuleInfoZ", referenced from:
>      _D10helloworld12__ModuleInfoZ in helloworld.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
> --- errorlevel 1
>
> Obviously I don't have any identifiers by these names.  I wrote a simple
> library which printf's "Hello
> World" and linked to it without problems.  So I thought the problem might
> be due to name mangling
> incompatibilities, so I recompiled libraw under gcc4.2 and llvm-gcc and got
> the same issue both times.
>
> Can anyone provide a clue?  I know the linker can't resolve the above, but
> I have no idea how to go
> about fixing it.
>
> Environment: Mac OS X 10.6.4, DMD v2.049.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20101102/ed72b6a3/attachment.html>


More information about the Digitalmars-d mailing list