当前位置:编程学习 > wap >>

请教大家一个关于调用静态库的问题

我在xcode 针对IPHONE模拟器的工程中建立了两个静态库和一个应用项目,这两个静态库可以被APP应用调用,但是如果是一个静态库调用另一个静态库,编译就会遇到问题。

比如静态库libEMMTC2S.a, LibEMNet.a, 应用是CallLibTest。 CallLibTest调用LibEMNet.a可以,但是libEMMTC2S.a 中调用LibEMNet.a(把LibEMNet.a 拖入libEMMTC2S.a的Link Binary With Library中),则编译库文件报错。 请教大家一下,这是什么原因造成的。

错误信息如下:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lEMNet
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lEMNet is not an object file (not allowed in a library)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk/usr/lib/libz.1.2.5.dylib is a dynamic library, not added to the static library
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool failed with exit code 1
补充:移动开发 ,  iPhone
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,