vinniefalco / FreeTypeAmalgam

The FreeType Project: a free, high-quality and portable font engine.
http://www.freetype.org
Other
48 stars 10 forks source link

XCode 4.3 link error #1

Open lmdsp opened 12 years ago

lmdsp commented 12 years ago

Compiling with Clang/darwin gives the following errors at link time: Thanks for your work, it saved me a lot of hassle ;)

Undefined symbols for architecture x86_64: "_z_verbose", referenced from: _inflateEnd in libgraphics.a(freetype_src.o) ZL19inflate_blocks_freeP20inflate_blocks_stateP10z_stream_s in libgraphics.a(freetype_src.o) __ZL20inflate_blocks_resetP20inflate_blocks_stateP10z_stream_sPm in libgraphics.a(freetype_src.o) ZL18inflate_codes_freeP19inflate_codes_stateP10z_stream_s in libgraphics.a(freetype_src.o) _inflate in libgraphics.a(freetype_src.o) ZL14inflate_blocksP20inflate_blocks_stateP10z_stream_si in libgraphics.a(freetype_src.o) ZL17inflate_codes_newjjP14inflate_huft_sS0_P10z_stream_s in libgraphics.a(freetype_src.o) ... "z_error(char*)", referenced from: __ZL13inflate_codesP20inflate_blocks_stateP10z_stream_si in libgraphics.a(freetype_src.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

lmdsp commented 12 years ago

I checked the amalgamated .c file and I cannot see a definition for z_verbose etc., so I guess this explains the problem

vinniefalco commented 12 years ago

You need to provide these two definitions somewhere in your code:

int z_verbose = 0;

void z_error (char* message)
{
  (message);
}
lmdsp commented 12 years ago

Thanks a lot, that did the trick. I'm sorry to have bothered you with this, but I saw no mention of it in the docs Strangely enough, the problem didn't appear under MSVC

Cheers, Lorcan

vinniefalco commented 12 years ago

No problem.

vinniefalco commented 12 years ago

This needs to be added to the documentation or something so other people don't get stuck.