下面将主要的雀老过程记录下来:
1、下载boost 源码:
Boost for Android
Boost for android is a set of tools to compile the main part of the Boost C++ Libraries for the Android platform.
Currently supported boost versions are 1.45.0, 1.48.0 and 1.49.0.
因此歼搜下载最新的 1.49 版本,下载完成后进行打补丁
2、下载补丁代码
boost-1_49_0
3、打补丁代码
boost_1_49_0.tar.bz2 放在android的 external 下解压:
tar -xjvf external/boost_1_49_0.tar.bz2
将boost-1_49_0.patch放在external\boost_1_49_0下面根目录执行:
patch -Np1 -d external/boost_1_49_0 <external/boost_1_49_0/boost-1_49_0.patch
4、编写boost的makefile文件,即Android.mk
LOCAL_PATH:= $(call my-dir)
common_SRC_FILES := \
顷改升libs/thread/src/pthread/thread.cpp \
libs/thread/src/pthread/once.cpp \
common_SRC_FILES += \
libs/filesystem/v3/src/codecvt_error_category.cpp \
libs/filesystem/v3/src/operations.cpp \
libs/filesystem/v3/src/path.cpp \
libs/filesystem/v3/src/path_traits.cpp \
libs/filesystem/v3/src/portability.cpp \
libs/filesystem/v3/src/utf8_codecvt_facet.cpp \
libs/system/src/error_code.cpp \
libs/system/src/local_free_on_destruction \
include $(CLEAR_VARS)
LOCAL_MODULE:= libboost
LOCAL_SRC_FILES := $(common_SRC_FILES)
prebuilt_stdcxx_PATH := prebuilts/ndk/current/sources/cxx-stl/gnu-libstdc++
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/boost \
$(prebuilt_stdcxx_PATH)/include \
$(prebuilt_stdcxx_PATH)/libs/$(TARGET_CPU_ABI)/include/ \
LOCAL_C_INCLUDES += \
$(prebuilt_stdcxx_PATH)/include \
$(prebuilt_stdcxx_PATH)/libs/$(TARGET_CPU_ABI)/include/ \
$(prebuilt_supccxx_PATH)/include
LOCAL_CFLAGS += -fvisibility=hidden -lpthread
LOCAL_CPPFLAGS += -fexceptions -frtti
LOCAL_SHARED_LIBRARIES := libc libstdc++ libstlport
LOCAL_LDFLAGS += -L$(prebuilt_stdcxx_PATH)/libs/$(TARGET_CPU_ABI) -lgnustl_static -lsupc++
LOCAL_MODULE_TAGS := optional
include $(BUILD_SHARED_LIBRARY)
比较重要的是上面 红色 部分文字
最后编译生成:
target thumb C++: libboost <= external/boost_1_49_0/libs/thread/src/pthread/thread.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/thread/src/pthread/once.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/codecvt_error_category.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/operations.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/path.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/path_traits.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/portability.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/filesystem/v3/src/utf8_codecvt_facet.cpp
target thumb C++: libboost <= external/boost_1_49_0/libs/system/src/error_code.cpp
target SharedLib: libboost (out/target/product/godbox/obj/SHARED_LIBRARIES/libboost_intermediates/LINKED/libboost.so)
target Symbolic: libboost (out/target/product/godbox/symbols/system/lib/libboost.so)
target Strip: libboost (out/target/product/godbox/obj/lib/libboost.so)
Install: out/target/product/godbox/system/lib/libboost.so
成功生成 libboost.so 库
1. 确保ARM编译成功安装,并配置好环境变量。2. 解压boost压缩包
3. 进入目录执行./bootstrap.sh, 此时形成bjam文件和project-config.jam
4. 编辑project-config.jam, 仅修改using gcc这行。因为我使用的是arm-linux-gcc,所以将其改以圆雀下即可:
using gcc : : arm-linux-gcc
5. 执洞宏行./bjam stage, ok大功告成.
6. 形成的静态和动态库文件就在stage目录下.
在得到boost 库后,把所需要的纳腔册库放在ARM linux文件系统
汗你这问题还真不好说
怀疑你ABC盘的磁盘碎片太多
不过我可以明确的告诉你,移动硬盘不适合用READYBOOST
因为READYBOOST的工作原理是利用U盘这样的存储介质零寻道时间的特性,来加速零碎文件的读取效率
以提高运行速度
而移动硬盘则还是像常规硬盘那样需要寻道时间
而且,为了提高移动硬盘的安全性能,它的态兄寻绝闭樱道时间会比常规硬盘更长,
与其用移动硬盘实现READYBOOST,不如分配更多的虚拟内存
更好的解决方并丛法是加条内存
(READYBOOST对内存1G以上的系统基本上不会加快运行速度)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)