当前位置:   article > 正文

IOS下Libevent编译步骤,及引入Xcode备忘_libevent ios

libevent ios
    0.先用:ls -al /usr/lib | grep libevent 查看是否已安装,如果已安装且版本低于1.3,则先通过:rpm -e libevent —nodeps 进行卸载。
  
  1.下载libevent安装包:libevent-2.0.22-stable.tar.gz,然后解压。
  
  2.切换到解压后的 libevent 主目录:cd libevent-2.0.22-stable
  
  3.依次执行:
  ./configure –prefix=/usr (或 ./configure --program-prefix=/usr)
  make
  make install






----ARM64
./configure --prefix=/Users/XX/lv --host=arm-apple-darwin --enable-static=yes --enable-shared=no CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc CFLAGS="-arch arm64 -pipe -std=c99 -Wno-extended-offsetof -Wno-trigraphs -fpascal-strings -O2 -Wreturn-type -Wunused-variable -fmessage-length=0 -fvisibility=hidden -miphoneos-version-min=6.0 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk/usr/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk" AR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar LDFLAGS="-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk -miphoneos-version-min=6.0"


---lipo

lipo -create /Users/XX/lv/lib/libevent_pthreads.a /Users/XX/build/built/iPhoneOS10.0-arm64.sdk/lib/libevent_pthreads.a -output /Users/xx/lv-all/libevent_pthreads.a


*注意替换路径


生成IOS平台的库文件(libevent_core.a,libevent_extra.a,libevent_pthreads.a)放到$path/ios/libraries中,注意:是IOS的库文件,不是linux的


   头文件放到$path/ios/libevent


  xcode中增加head search path 和 添加刚才的3个库文件


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/742801
推荐阅读
相关标签
  

闽ICP备14008679号