What's the correct way to load zlib via LDFLAGS in Makefile in LLVM?

my CFLAGS have

-I../../usr/local/sys/usr/include

      

which loads zlib.h correctly

LDFLAGS

LDFLAGS = -L../../usr/local/sys/usr/lib -lxml2 -lzlib

      

But when the linker tries to link the following events

1>   + Linking project files...
1>  ld: library not found for -lzlib
1>  collect2: ld returned 1 exit status
1>  make: *** [link] Error 1

      

What could be the problem?

Environment is iosdevenv under windows7 (so directory structure is different from mac os structure)

+3


source to share


2 answers


The solution is to use the -lz flag instead of -lzlib.



Tested, project related.

+2


source


libz.dylib

lives in / usr / lib of your iPhone SDK.

Display the correct path to libz.dylib

, and then change the path " -L

" in LDFLAGS

to match.



On my car this /Application/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk/usr/lib/libz.dylib

+1


source







All Articles