zLib 链接错误 XCode 4,未定义的符号
链接错误:
Undefined symbols for architecture i386: "_unzOpen", referenced from:
我的 xcode 项目中有一个 libz.dylib (构建阶段/链接二进制文件与库) 还可以看到 -lz 链接标志
Ld Debug/DemoOSX_d.app/Contents/MacOS/DemoOSX_d normal i386
cd /Projects/Scorpio/DemoOSX
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Developer/usr/bin/clang++ -arch i386 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Projects/Scorpio/DemoOSX/Debug -L/Projects/Scorpio/DemoOSX/../LibMacOS -F/Projects/Scorpio/DemoOSX/Debug -F/Developer/SDKs/MacOSX10.7.sdk/usr/lib -filelist /Projects/Scorpio/DemoOSX/Debug/DemoOSX.build/Objects-normal/i386/DemoOSX_d.LinkFileList -mmacosx-version-min=10.7 -lz /Projects/Scorpio/DemoOSX/../LibMacOS/SysAudio_d.a /Projects/Scorpio/DemoOSX/../LibMacOS/SysUtils_d.a -lexpat -logg -lvorbis -lvorbisfile /Projects/Scorpio/DemoOSX/../LibMacOS/SysMath_d.a /Projects/Scorpio/DemoOSX/../LibMacOS/SysMemManager_d.a -framework OpenAL -framework SDL -framework Cocoa -o /Projects/Scorpio/DemoOSX/Debug/DemoOSX_d.app/Contents/MacOS/DemoOSX_d
1) 尝试在文件检查器中检查扩展名 - mach o 动态库
2) 尝试构建 32/64 位应用程序
3) 添加其他链接器标志“usr/lib/libz.dylib”
4) 尝试添加标头搜索路径 /usr/include
没有任何帮助:(,可能需要自行构建
ARCHS 32 位英特尔 SDK_ROOT最新10.7 GCC_VERSION 苹果 LLVM 3.0
link err:
Undefined symbols for architecture i386: "_unzOpen", referenced from:
I have a libz.dylib in my xcode project (Build Phases/Link binaries with library)
also can see -lz link flag
Ld Debug/DemoOSX_d.app/Contents/MacOS/DemoOSX_d normal i386
cd /Projects/Scorpio/DemoOSX
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Developer/usr/bin/clang++ -arch i386 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Projects/Scorpio/DemoOSX/Debug -L/Projects/Scorpio/DemoOSX/../LibMacOS -F/Projects/Scorpio/DemoOSX/Debug -F/Developer/SDKs/MacOSX10.7.sdk/usr/lib -filelist /Projects/Scorpio/DemoOSX/Debug/DemoOSX.build/Objects-normal/i386/DemoOSX_d.LinkFileList -mmacosx-version-min=10.7 -lz /Projects/Scorpio/DemoOSX/../LibMacOS/SysAudio_d.a /Projects/Scorpio/DemoOSX/../LibMacOS/SysUtils_d.a -lexpat -logg -lvorbis -lvorbisfile /Projects/Scorpio/DemoOSX/../LibMacOS/SysMath_d.a /Projects/Scorpio/DemoOSX/../LibMacOS/SysMemManager_d.a -framework OpenAL -framework SDL -framework Cocoa -o /Projects/Scorpio/DemoOSX/Debug/DemoOSX_d.app/Contents/MacOS/DemoOSX_d
1) tried check extension in file inspector - mach o dynamic library
2) tried build 32/64 bit app
3) add other linker flags "usr/lib/libz.dylib"
4) tried add header search path /usr/include
nothing help:(, probably need to build itself
ARCHS 32bit intel
SDK_ROOT Latest 10.7
GCC_VERSION Apple LLVM 3.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
unzOpen
函数是“minizip”的一部分,“minizip”是 zlib 的一个附加组件,但不包含在 Apple 版本的 zlib 中。您需要访问 zlib.net 获取 minizip 的源代码。The
unzOpen
function is part of "minizip", an add-on to zlib that is not included in Apple's version of zlib. You need to go to zlib.net to get the source code for minizip.