在LLVM下通过Makefile通过LDFLAGS加载zlib的正确方法是什么? [英] What is correct way to load zlib via LDFLAGS in a Makefile under LLVM?

查看:196
本文介绍了在LLVM下通过Makefile通过LDFLAGS加载zlib的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的CFLAGS有

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

正确加载zlib.h

which correctly loads zlib.h

LDFLAGS是

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

但是当链接器尝试链接时,会发生以下情况

But when linker tries to link following occures

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

可能是什么问题?

Windows7下的环境为iosdevenv(因此目录结构与mac os上的目录结构不同)

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

推荐答案

解决方案是使用-lz标志而不是-lzlib.

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

经过测试,已链接项目.

Tested, project linked.

这篇关于在LLVM下通过Makefile通过LDFLAGS加载zlib的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆