Android framework中使用stl库
来源:互联网 发布:大学毕业后悔做程序员 编辑:程序博客网 时间:2024/06/04 19:33
在Android的framework或者ndk中使用stl库中的方法,如std::string 时需要修改Android.mk文件添加相应的库支持。
主要步骤如下:
LOCAL_SHARED_LIBRARIES中添加libstlport;
LOCAL_C_INCLUDES中添加 external/stlport/stlport bionic bionic/libc/private
如下为本文修改的方法:
# Copyright (C) 2010 The Android Open Source Project## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.LOCAL_PATH:= $(call my-dir)include $(CLEAR_VARS)LOCAL_SRC_FILES := test.cppLOCAL_SHARED_LIBRARIES := \ libandroid_runtime \ libcutils \ libutils \ liblog \ libnativehelper \ libstlport \ LOCAL_C_INCLUDES += \ $(JNI_H_INCLUDE) \ external/stlport/stlport \ bionic \ bionic/libc/private \ LOCAL_MODULE:= liblsphoneinclude $(BUILD_SHARED_LIBRARY)
使用demo
在cpp中使用std标准库中的string类时需要注意如下步骤:
1.导入头文件
#include <string>
2.添加类的引用命名空间
using namespace std;
0 0
- Android framework中使用stl库
- Android ndk 中使用STL
- Android ndk 中使用STL .
- Android NDK 中使用STL
- 在Android源码环境中使用STL库
- 如何在android app中使用STL库
- 怎么在android app中使用STL库
- STL中bind库使用
- android 中 datacall framework
- android 中使用socket使native和framework通信
- android 中使用socket使native和framework通信
- android 中使用socket使native和framework通信
- android 中使用socket使native和framework通信
- android 中使用socket使native和framework通信
- android 中使用socket使native和framework通信
- android 中使用socket使native和framework通信
- android 中使用socket使native和framework通信
- android 中使用socket使native和framework通信
- 博客收藏
- BW310学习一
- springmvc返回json的日期格式问题
- php读取xml文件,并存入数据库
- MyBatis中一对多关联查询
- Android framework中使用stl库
- mysql导入数据load data infile用法
- 在前台,以session为查询条件,查询数据库。 seer_name的值就是当前系统的session值。
- Zulip聊天机器人Python开发
- MySQL数据库优化(三)
- 浏览器的工作原理:新式网络浏览器幕后揭秘
- FZU 2242 Daxia like acute triangle
- Ehcache缓存框架小案例
- 鱼眼校正之类1