代码从windows下visual studio到andriod平台迁移实现步骤
作者:lqh 发布时间:2022-05-23 11:21:39
标签:windows,visualstudio,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& {aka std::basic_string<char>&}' 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.
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
来源:http://blog.csdn.net/cartzhang/article/details/37930317


猜你喜欢
- 在方法声明中只允许一个paras关键字,并且该关键字只能为最后一个。using System; /*********************
- 前言作为一个新手,最近在学习C#,自己折腾弄了个简单的小说爬虫,实现了把小说内容爬下来写入txt,还只能爬指定网站。第一次搞爬虫,涉及到了网
- 在使用多线程的时候有时候我们会使用 java.util.concurrent.Executors的线程池,当多个线程异步执行的时候,我们往往
- 一、如何显示assets/license.txt(中文)的内容? (1)方法1:InputStream.available()得到字节数,然
- 本文实例为大家分享了Java实现FTP上传与下载的具体代码,供大家参考,具体内容如下JAVA操作FTP服务器,只需要创建一个FTPClien
- 一、前言系统执行业务逻辑之前,会对输入数据进行校验,检测数据是否有效合法的。所以我们可能会写大量的if else等判断逻辑,特别是在不同方法
- 本文实例讲述了C#动态执行批处理命令的方法。分享给大家供大家参考。具体方法如下:C# 动态执行一系列控制台命令,并允许实时显示出来执行结果时
- 方法的返回值为什么要有带返回值的方法呢?调用处拿到方法的结果之后,才能根据结果进行下一步操作带返回值方法的定义和调用:如果在调用处,要根据方
- 复制文件并命名的超简洁写法没错又是我,这次为大家带来Java中 复制文件并命名的超简洁写法(请确保你的jre在1.8+),这次用到了File
- C++ 中const修饰虚函数实例详解【1】程序1#include <iostream>using namespace std;
- 相对于Swing来说,JavaFX在UI上改善了很多,不仅可以通过FXML来排版布局界面,同时也可以通过CSS样式表来美化UI。其实在开发J
- Java常用类包装类由于Java语言中的基本类型不是面向对象,并不具备对象的性质,实际使用存在很多不便。Java在java.lang包中提供
- 在做在线编程题目的时候,需要了解一下数据的输入格式。这样可以对数据处理有比较好的把握,不需要把太多的时间放在这个上面,注重主要的算法逻辑即可
- 多继承指一个子类能同时继承于多个父类,从而同时拥有多个父类的特征,但缺点是显著的。1.若子类继承的父类中拥有相同的成员变量,子类在引用该变量
- 加载图片openCv有一个名imread的简单函数,用于从文件中读取图像imread 函数位于Imgcodecs类的同名包中。加载图片代码i
- 简介java 8 stream作为流式操作有两种操作类型,中间操作和终止操作。这两种有什么区别呢?我们看一个peek的例子:Stream&l
- 前言 开始始学习android,对android的启动模式没有什么了解,就使用了时间判断是否重复点击了两次按钮,启动另外的activity界
- java 线程锁在Java线程中运用synchronized关键字来达到同步的 synchronized可以锁方法,锁类,锁对象,锁代码块方
- 为什么要使用Lambda?可以对一个接口进行非常简洁的实现。Lambda对接口的要求?接口中定义的抽象方法有且只有一个才可以。传统实现一个接
- 一、使用方式可以采用Transactional,配置propagation即可。打开org.springframework.transact