I have a custom libz.a library (it includes the unzip functionality, which the system libz does not).
When I compile my application, I get:
/usr/bin/ld: Undefined symbols:
_unzClose
_unzCloseCurrentFile
_unzGetCurrentFileInfo
(i.e. all the functions that are in my libz and not the system libz)
I compile with (the -L and -l flags are bolded for emphasis and are correctly specified)
gcc version 4.0.1 (Apple Computer, Inc. build 5363)
/usr/libexec/gcc/i686-apple-darwin8/4.0.1/collect2 -dynamic -arch i386 -macosx_version_min 10.3 -multiply_defined suppress -weak_reference_mismatches non-weak -o ./objd/test_prog -lcrt1.o /usr/lib/gcc/i686-apple-darwin8/4.0.1/crt3.o -L../../lib/bind/ -L../../sdk/mac/lib -L../../sdk/mac/freetype/objs/.libs -L../../sdk/mac/antlr/lib/cpp/src -L../../sdk/mac/jpeg -L../../sdk/mac/gmp/.libs -L../../sdk/mac/HID Utilities Source/build/Deployment -L../../sdk/mac/FFB SDK/CFM_FFB/FFB headers -L/usr/lib/gcc/i686-apple-darwin8/4.0.1 -L/usr/lib/gcc/i686-apple-darwin8/4.0.1 -L/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../.. ./objd/app.o ./objd/app_input.o ./objd/main.o ./objd/movie.o ./objd/msgqueue.o ./objd/player.o -lflight -lflight2 -lsound -lsound2 -lmeta -lnet -ljoystick -lcrypt -lwindow -lgui2 -lscene -lscene2 -lluabase -llua -lhash -lcampaign -lvector -lai -lutil -lmac -lz -lfreetype -lantlr -ljpeg -lgmp -lHIDUtilities -lmac_ffb -framework Carbon -framework OpenGL -framework System -framework AGL -framework DrawSprocket -framework IOKit -framework CoreFoundation -framework ForceFeedback -framework openal -framework libcurl -lstdc++ -lgcc_s.10.4 -lgcc -lSystem -F../../sdk/mac/openal/OpenAL-MacOSX/build/Deployment -F../../sdk/mac/curl/lib
Compiling with -whyload, the first reference to libz is this:
usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libz.dylib(deflate.o) loaded to resolve symbol: _deflate referenced from CoreGraphics
This leads me to believe that because CoreGraphics references libz, the system libz is being loaded and thus my library is never loaded.
How can I change this so that my libz is loaded first?