移植leveldb到hi3519

1.编译环境

2.移植步骤

  • 修改build_detect_platform文件:

    • 添加海思编译工具
if test -z "$CC"; then
    CC=gcc
fi

CXX=arm-hisiv500-linux-g++
if test -z "$CXX"; then
    CXX=g++
fi
  • 修改db/db_iter.h文件

在#endif前添加如下一行

typedef int ssize_t;
如果不定义会出现如下错误:

arm-hisiv500-linux-g++ -I. -I./include -std=c++0x -fno-builtin-memcmp -lpthread -DOS_LINUX -DLEVELDB_PLATFORM_POSIX -DLEVELDB_ATOMIC_PRESENT -O2 -DNDEBUG -fPIC -c db/db_iter.cc -o out-shared/db/db_iter.o
db/db_iter.cc:107:3: error: ‘ssize_t’ does not name a type
   ssize_t RandomPeriod() {
   ^
db/db_iter.cc:123:3: error: ‘ssize_t’ does not name a type
   ssize_t bytes_counter_;
   ^
db/db_iter.cc: In constructor ‘leveldb::{anonymous}::DBIter::DBIter(leveldb::DBImpl*, const leveldb::Comparator*, leveldb::Iterator*, leveldb::SequenceNumber, uint32_t)’:
db/db_iter.cc:60:9: error: class ‘leveldb::{anonymous}::DBIter’ does not have any field named ‘bytes_counter_’
         bytes_counter_(RandomPeriod()) {
         ^
db/db_iter.cc:60:37: error: ‘RandomPeriod’ was not declared in this scope
         bytes_counter_(RandomPeriod()) {
                                     ^
db/db_iter.cc: In member functionbool leveldb::{anonymous}::DBIter::ParseKey(leveldb::ParsedInternalKey*)’:
db/db_iter.cc:132:3: error: ‘ssize_t’ was not declared in this scope
   ssize_t n = k.size() + iter_->value().size();
   ^
db/db_iter.cc:133:3: error: ‘bytes_counter_’ was not declared in this scope
   bytes_counter_ -= n;
   ^
db/db_iter.cc:133:21: error: ‘n’ was not declared in this scope
   bytes_counter_ -= n;
                     ^
db/db_iter.cc:135:36: error: ‘RandomPeriod’ was not declared in this scope
     bytes_counter_ += RandomPeriod();
                                    ^
Makefile:415: recipe for target 'out-shared/db/db_iter.o' failed
make: *** [out-shared/db/db_iter.o] Error 1
  • 编译:make
  • 编译后生成的库和头文件在如下目录:out-shared out-static include
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值