代码从windows下visual studio到andriod平台迁移实现步骤

代码从windows下visual studio到andriod平台迁移实现步骤:

前言

前言也是迁言,从windows的visual studio 2012平台迁移到Android平台上,需用修改挺多的代码和需用注意地方。

我们当然的平台当初就考虑了其他平台跨平台的应用问题,所以一开始在windows下就是用cmake来完成工程的建立的,cMakeLists.txt文件都做了一些处理,但是此时只是更针对或说首先保证windows下的编译和使用。

谨此做个记录。

1. modify cMakeLists.txt file,add android define and macro.

2.cmake ./../
	Build files have been written to: /home/andriod_a/build

3.size_t problem add <cstddef> head file.

4.error: extra qualification 'rw::scoped_lock::' on member 'scoped_lock' [-fpermissive]
 remove the class identifier.

5. memcpy define in <string.h> .so change it.

6.no match for 'operator=' in 'inverse = rw_math::matrix3f::operator*(float) const((1.0e+0f / det))'

//inverse = inverse * (1.0f/det);
	matrix3f temp = inverse * (1.0f/det);
	inverse = temp;

7.no match for 'operator=' in 'rot_mat = rw_math::matrix4f::make_rotation_matrix(
 matrix4f matrix4f_tmp = make_rotation_matrix(axis_,angle_in_rad_);
  rot_mat = matrix4f_tmp;

8.warning: inline function 'double const& rw_math::vector3d::operator[](int) const' used but never defined [enabled by default]

9.error: 'memcmp' was not declared in this scope
 #include <string.h>

10.initializing argument 2 of 'char* strncat(char*, char const*, size_t)' [-fpermissive]

11.compile jpeg library.
	copy source code,then write or change cMakeLists.txt,then create a buid file,open terminal in the new build file.
	cmake ./../ ,the last is make ,and it will show u.
12.multiple definition of 'std::__lg(int)
	i define the inline,so error.

13. the inline function which must achieve in head file ,and could not in *.cpp file. or,u can delete inline word in head files.

14. conflicts with previous declaration 'typedef class rw::rw_shared_ptr<rw_json::json_value_iterator> rw_json::json_value_iterator::ptr'

	 multidefine .
15.no matching function for call to 'transform()
	transform(ext_.begin(), ext_.end(), ext_.begin(), ::tolower);

16. temp varity can't assign to non-const reference.
	rw_shared_ptr_shadow temp_shadow = entity_.to_shared_ptr_shadow();
	pt2model_entity_define::ptr temp_ptr = temp_shadow.to_shared_ptr<pt2model_entity_define>();
	build_pt2model_entity(_pGeometry,_pSymbol,temp_ptr);
17.	fatal error: json\json.h: No such file or director
		#include <json\json.h> ----->#include <json/json.h>
18.	fatal error: zlib\\zconf.h: No such file or directory
	----->#include "zlib/zlib.h"
19. error: cannot pass objects of non-trivially-copyable type 'const mapped_type {aka const struct std::basic_string<char>}' through '.
	--->(content_type_field).c_str();
20.537:49: error: invalid initialization of non-const reference of type 'std::string' from an rvalue of type 'std::string {aka std::basic_string<char>}'
	string temp_str = request_.get()->get_url();
		string& tmp_req_url = temp_str;
21. error: no matching function for call
	temp variaty problem. make a temp variaty.
	matrix4d temp_mat = world_mat * t_mat;
	render_system_->set_world_matrix(temp_mat);
22.	abs()--->fabs();

23.rw_terrian_manager.h:69:12: error: 'terrian_tile' was not declared in this scope
	can not recongize the friend class in GCC ,so chang forward declaration.
	#ifdef __linux__
	class terrian_tile;
	#endif
24. Windows.h: No such file or directory
		linux not compile this model,and commit it.
25.	itoa---->

	#include <sstream>
	std::ostringstream oss;
	std::string str = "";
	oss << _counter;
	str = oss.str();
26.	error: taking address of temporary
	box3d bbox = (instances_[i]->get_bounding());
	if (!manipulate_geo_hash(instances_[i]->get_id(), &bbox, update_geo_hash))
	ta
27.	error: no matching function for call to 'transform(std::basic_string<char>::iterator, std::basic_string<char>::iterator, std::basic_string<char>::iterator, <unresolved overloaded function type>)'
    transform(_texture_type.begin(), _texture_type.end(), _texture_type.begin(), ::tolower);

28.	GetModuleFileName((HINSTANCE)&__ImageBase,buffer,256);
		#include <stdio.h>
		------->string buffer = getcwd(NULL, 0);
		string execution_path= buffer;
29. xstring ----><string>

30.invalid cast of an rvalue expression of type 'rw::multi_point::ptr {aka rw::rw_shared_ptr<rw::multi_point>}' to type 'rw::multi_point*&'
		temp variable error.
31.	error: 'atof' was not declared in this scope
			std::stringstream oss;
			int temp_int;
			oss << _pri_string;
			oss >> temp_int;
			_var = temp_int;
32.error: conflicts with previous declaration
	u known, have more than one define in u's file.so,find and delete it.
33.	malloc no declear.
	#include <malloc.h>

34. 	image_info_->image_type = image_type_;
	 rw_image :image_type("ccccccccccccccccc"),

35. don't write like this.
			_runtime->register_service(_aaaa_multi_service_pid, get_aaa_multi_service());
			((_driver_multi_service_impl*)get_aaa_multi_service())->init(_runtime);
			((_driver_multi_service_impl*)get_aaa_multi_service())->set_runtime(_runtime);
36.	 register_service at last place when add_multi_service.
		((terrian_data_sqlite_service_impl*)tms)->init();
		_runtime->register_service(terrian_data_sqlite_service_pid, tms );

37.	dom does not show,because android system does not support multi-therad rendering.
	so ,put the upload in draw thread.

38.please set RW_INDEX rw_uint16 in rw_render_object_creator.cpp when u compile the code in android system,otherwise leave it alone.

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

(0)

相关推荐

  • Andriod arcgis保存Mapview为图片的实例代码

    废话不多说了,直接给大家贴代码了,具体代码如下所述: /** * 把一个View的对象转换成bitmap */ private Bitmap getViewBitmap(MapView v) { v.clearFocus(); v.setPressed(false); //能画缓存就返回false boolean willNotCache = v.willNotCacheDrawing(); v.setWillNotCacheDrawing(false); int color = v.getDr

  • Andriod开发中常见问题

    本文为大家总结了Andriod开发中常遇到的问题,供大家学习,具体内容如下 1.Andriod中布局中引用布局的问题 (使用如下方法即可,布局中引用布局可以起到节省资源的问题) <LinearLayout> <include layout="@layout/buttom"> </LinearLayout> 2.如何判断你的手机版本是不是4.0以上 if(Android.os.Build.VERSION.SDK_INT>10) 3.屏幕切换问题和

  • Andriod开发中引入jar包的正确方式介绍

    andriod中如果引入jar包的方式不对就会出现一些奇怪的错误. 工作的时候恰好有一个jar包需要调用,结果用了很长时间才解决出现的bug. 刚开始是这样引用的(eclipse): 右键工程,Build path,java build path, 选择libraries,在右边的按钮中点击"Add External JARs", 然后选择合适的jar包(大部分人应该会这样做). 结果控制台立刻报错:conversion to dalvik format failed with err

  • Java实现Andriod带看括弧的计算器代码

    废话不多说了,一切尽在代码中,具体代码如下所示: 界面 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_par

  • Andriod 自定义控件之音频条

    今天我们实现一个直接继承于View的全新控件.大家都知道音乐播放器吧,在点击一首歌进行播放时,通常会有一块区域用于显示音频条,我们今天就来学习下,播放器音频条的实现. 首先我们还是先定义一个类,直接继承于View,并重写它的构造方法,并初始化一个画笔,这和上一节是同样的道理.直接贴出代码: public class AudioBar extends View{ private Paint mTextPaint; public AudioBar(Context context) { this(co

  • Andriod 读取网络图片实例代码解析

    Android手机上,我们常用ImageView显示图片,我们本章获取网络图片并显示在ImageView中. 一.设计界面 1.布局文件 打开res/layout/activity_main.xml文件. 输入以下代码: <?xml version="." encoding="utf-"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android&qu

  • Andriod 资源文件之存取操作

    废话不多说了,直接给大家贴代码了.具体代码如下所述: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="mat

  • Andriod学习教程之滑动布局(14)

    本文实例为大家分享了Andriod滑动布局的具体代码,供大家参考,具体内容如下 MainActivity.java代码: package siso.swipelayoutdemo; import android.app.Activity; import android.content.Intent; import android.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.B

  • Andriod 获取电池的信息实例代码

    具体代码如下所示: <?xml version="1.0"?> <LinearLayout android:orientation="vertical" android:layout_height="match_parent" android:layout_width="match_parent" xmlns:tools="http://schemas.android.com/tools"

  • 代码从windows下visual studio到andriod平台迁移实现步骤

    代码从windows下visual studio到andriod平台迁移实现步骤: 前言 前言也是迁言,从windows的visual studio 2012平台迁移到Android平台上,需用修改挺多的代码和需用注意地方. 我们当然的平台当初就考虑了其他平台跨平台的应用问题,所以一开始在windows下就是用cmake来完成工程的建立的,cMakeLists.txt文件都做了一些处理,但是此时只是更针对或说首先保证windows下的编译和使用. 谨此做个记录. 1. modify cMakeL

  • Windows下Visual Studio 2017安装配置方法图文教程

    Windows下Visual Studio 2017 安装,具体内容如下 1.打开下载页. 打开VS产品下载页面,链接 2.选择版本下载 选择相应的版本(社区,Professional,企业版)下载,这里以下载社区版为例.点击"社区"下方的"免费下载"按钮.网页会自动跳转到如下页面,并自动下载相应的安装程序(若没有自动下载,点击提示信息中的"点击此处重试"). 3.开始安装 打开已经下载好的vs_community.exe. 会出现如下界面,按&

  • Visual Studio安装git插件的方法步骤

    在Visual Studio 中使用git--什么是Git(一) 如果要使用git进行版本管理,其实使用git命令行工具就完全足够了,图形化工具(无论是git extentions,还是TortoiseGit),都只不过是命令行的封装.就功能而言,他们能做的,命令行全部可以做到:但命令行能做的,他们不 一定可以做到.命令行更加原生.本色,跨越平台,以一当十.建议熟悉git命令行工具.但图形化工具也有自己的优点,就是直观. Visual Studio 2019中自带Git功能.如下图. 2.Vis

  • windows下使用GoLand生成proto文件的方法步骤

    目录 下载编译器protoc 1.使用google官方protoc 2.使用三方protoc,比如我使用的gogo的protoc 设置环境变量 编写proto文件 将proto文件编译为pb.go文件 下载编译器protoc 两种方式: 1.使用google官方protoc 下载地址:https://github.com/google/protobuf/releases 2.使用三方protoc,比如我使用的gogo的protoc 下载地址:https://github.com/gogo/pro

  • 使用Visual Studio 2010/2013编译V8引擎步骤分享

    使用Visual Studio 2013编译V8引擎 复制代码 代码如下: 准备工作,安装Python2.x,git,svn: Git: http://msysgit.github.io SVN:http://www.sliksvn.com/en/download Python:https://www.python.org/downloads/ 第一步,获取V8源码: https://github.com/v8/v8-git-mirror 第二步,获取cygwin,放到V8源码下的third_p

  • Windows下搭建FFmpeg开发调试环境的详细步骤

    目录 背景 步骤 一.安装VS 2017 二.安装 YASM 与 NASM 三.创建正确的目录层次 四.下载源码和相关依赖 五.编译与调试 ⏭️ 一键部署脚本 背景 如果你是一个FFmpeg的使用者,那么绝大部分情况下只需要在你的程序中引用FFmpeg的libav*相关的头文件,然后在编译阶段链接相关的库即可. 但是如果你想调试FFmpeg内部相关的逻辑,或者分析FFmpeg源码,那么有一个可供单步调试FFmpeg的环境往往能使你事半功倍! 要说Windows下做C/C++开发用哪个IDE最强大

  • Windows下MySQL8.0.11社区绿色版安装步骤图解

    在本教程中使用MySQL最新的MySQL服务8.0.11的社区绿色版本进行安装,绿色版为zip格式的包,安装分为以下四步走: 第一步: 下载MySQL社区绿色版服务包 第二步: 新建并配置MySQL的初始化" my.ini "文件 第三步: 使用安装命令进行安装,安装完成后进行初始化 第四步: 启动MySQL服务 第五步: 登陆,修改密码后再登录 第一步: mysql-8.0.11-winx64位绿色版CSDN下载 https://download.csdn.net/download/

  • Visual Studio 2017正式版发布 亮点看这里

    Visual Studio 2017 正式版发布,该版本不仅添加了实时单元测试.实时架构依赖关系验证等新特性,还对许多实用功能进行了改进,如代码导航.IntelliSense.重构.代码修复和调试等等.无论使用哪种语言或平台,都能节省开发者在日常任务上花费的时间和精力. 此外,该版本还带来了一个新的轻量化和模块化的安装体验,可根据需要量身定制安装.多个增强功能汇集在一起,使 Visual Studio 2017 的启动速度比 Visual Studio 2015 快3倍,解决方案加载时间缩短 2

  • Visual Studio 2022下载安装与使用超详细教程

    目录 前言 一.Windows安装Visual Studio 2022 1.1 下载地址 1.2 开始安装 1.3 打开Visual Studio 二.Visual Studio创建一个新的项目 2.1 一些准备工作 2.2 创建一个新的项目 2.3 创建C文件 前言 本文用于记录Visual Studio 2022的安装与使用,将持续进行更新.当前版本:V1,2021.12.04 一.Windows安装Visual Studio 2022 1.1 下载地址 首先登陆Visual Studio官

  • 一文教你将Visual Studio Code变成Python开发神器

    目录 安装 Visual Studio Code 在 VS Code 中创建和运行 Python 文件 使用 REPL 格式化 Python 代码 重构 Python 代码 Python 交互窗口 Visual Studio Code 是一款功能强大.可扩展且轻量级的代码编辑器,经过多年的发展,已经成为 Python 社区的首选代码编辑器之一 下面我们将学习如何安装 Visual Studio Code 并将其设置为 Python 开发工具,以及如何使用 VS Code 提高编程工作效率 Let

随机推荐