Cocos2d-x iOS Mac环境编译出错 can't locate file for: -lpng -ljpeg -ltiff -lwebp -lfreetype -lwebsockets -l

83 篇文章 0 订阅

Cocos2d-x iOS Mac环境编译出错 can't locate file for: -lpng -ljpeg -ltiff -lwebp -lfreetype -lwebsockets -lcurl

在Mac上用Xcode6编译错误,在windows下面Visual Studio 编译没问题,然后查看报错信息:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool:
can't locate file for
file: -lpng is not an object file (not allowed in a library)
复制代码
 1 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lpng
 2 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lpng is not an object file (not allowed in a library)
 3 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -ljpeg
 4 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -ljpeg is not an object file (not allowed in a library)
 5 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -ltiff
 6 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -ltiff is not an object file (not allowed in a library)
 7 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lwebp
 8 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lwebp is not an object file (not allowed in a library)
 9 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lfreetype
10 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lfreetype is not an object file (not allowed in a library)
11 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lwebsockets
12 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lwebsockets is not an object file (not allowed in a library)
13 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lcurl
14 error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lcurl is not an object file (not allowed in a library)
复制代码

原因其实很简单,就是Cocod2d-x的Mac和iOS静态库没有搜索到,

一般是使用svn客户端没有正确上传.a导致的,

 

解决方法:把找到对应版本的Cocod2d-x相应目录下面的.a文件复制到相应目录下,

然后把.a的静态库添加到svn的版本控制里面;

使用命令 

svn add  路径/静态库.a 

 

iOS的库文件路径如下:

复制代码
/opt/cocos2d-x-3.2> find . -type  f | grep -i ios/lib
./external/curl/prebuilt/ios/libcurl.a
./external/freetype2/prebuilt/ios/libfreetype.a
./external/jpeg/prebuilt/ios/libjpeg.a
./external/lua/lua/prebuilt/ios/liblua.a
./external/lua/luajit/prebuilt/ios/libluajit.a
./external/png/prebuilt/ios/libpng.a
./external/tiff/prebuilt/ios/libtiff.a
./external/webp/prebuilt/ios/libwebp.a
./external/websockets/include/ios/libwebsockets.h
./external/websockets/prebuilt/ios/libwebsockets.a
./plugin/plugins/flurry/proj.ios/libFlurry.a
./plugin/plugins/umeng/proj.ios/libMobClickLibrary.a

来自:http://www.cnblogs.com/changbiao/p/4178667.html
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

VCHH

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值