赞
踩
前言:上次很兴奋,因为在Ubuntu上交叉编译了libevent的静态库,可是悲剧的是拿到windows上,用cygwin做链接的时候死活过不去,报event_init等一堆的未实现,可是静态库明明就在obj/local/armeabi目录下,并且打开静态库,也能找到对应的到处函数,为啥就是报找不到呢?反正我暂时还未搞懂,但是后来用cygwin编译出来的版本,貌似静态库有点区别,因为NDK的编译我还没搞清楚,在Ubuntu上我是指明了platforms和对应的编译器,不知道是否是不匹配造成的,不然NDK的目录里面也没必要有那么多gcc和ld的版本。由于才接触非windows平台的程序编译,总之就是糊里糊涂的,但是至少后来还是找了个办法在win7下使用cygwin编译出了cocos2dx能用的android版本的libevent。
操作系统 | Win7 64bit |
---|---|
辅助编译环境 | cygwin 1.7.14 |
编译器 | NDK r8e |
libevent版本 | 2.0.21-stable(for Android) |
####################################
# Build libevent as separate library
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_ARM_MODE:= arm
LOCAL_MODULE:= event_static
LOCAL_MODULE_TAGS:= optional
# bufferevent_openssl.c
LOCAL_SRC_FILES := \
buffer.c \
bufferevent.c \
bufferevent_filter.c \
bufferevent_pair.c \
bufferevent_ratelim.c \
bufferevent_sock.c \
epoll.c \
epoll_sub.c \
evdns.c \
event.c \
event_tagging.c \
evmap.c \
evrpc.c \
evthread.c \
evthread_pthread.c \
evutil.c \
evutil_rand.c \
http.c \
listener.c \
log.c \
poll.c \
select.c \
signal.c \
strlcpy.c
# external/openssl/include
LOCAL_C_INCLUDES := \
$(LOCAL_PATH) \
$(LOCAL_PATH)/android \
$(LOCAL_PATH)/include
LOCAL_CFLAGS := -DHAVE_CONFIG_H -DANDROID -fvisibility=hidden
include $(BUILD_STATIC_LIBRARY)
#include $(BUILD_SHARED_LIBRARY)
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes \
...
$(LOCAL_PATH)/../../../../libevent \
$(LOCAL_PATH)/../../../../libevent/include \
$(LOCAL_PATH)/../../../../libevent/android
...
LOCAL_WHOLE_STATIC_LIBRARIES += event_static
...
$(call import-module,libevent)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。