代码从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.
非常感谢我的同事sun同学的帮助!
==============THE END=============
代码从windows下visual studio到andriod平台迁移的修改记录的更多相关文章
- Windows下visual studio code搭建golang开发环境
Windows下visual studio code搭建golang开发环境 序幕 其实环境搭建没什么难的,但是遇到一些问题,主要是有些网站资源访问不了(如:golang.org),导致一些包无法安装 ...
- Windows下Visual studio 2013 编译 Audacity
编译的Audacity版本为2.1.2,由于实在windows下编译,其源代码可以从Github上取得 git clone https://github.com/audacity/audacity. ...
- windows下Visual Studio Code 1.9安装
点击送你去官网下载vs code 进入下载页面如下 下载完成双击安装 安装完成打开之后如下图,最新版的默认中文就挺好的! 注意下面是微软建议: Note: .NET Framework 4.5.2 i ...
- Windows下Visual Studio 2013编译Lua 5.2.3
1.创建一个Visual C++的Empty Project,如果需要支持Windows XP将Platform Toolset设置为Visual Studio 2013 - Windows XP ( ...
- 【Lua学习笔记之:Lua环境搭建 Windows 不用 visual studio】
Lua 环境搭建 Windows 不用 visual studio 系统环境:Win7 64bit 联系方式:yexiaopeng1992@126.com 前言: 最近需要学习Unity3d游戏中的热 ...
- Win8下Visual Studio编译报“无法注册程序集***dll- 拒绝访问。请确保您正在以管理员身份运行应用程序。对注册表项”***“的访问被拒绝。”问题修正(转)
原来在Win7下Visual Studio跑的好好的程序,现在在Win8下编译报“无法注册程序集***dll- 拒绝访问.请确保您正在以管理员身份运行应用程序.对注册表项”***“的访问被拒绝.”的错 ...
- Windows 7 Visual Studio 2008配置OpenGL开发环境
Windows 7 Visual Studio 2008配置OpenGL开发环境 glut下载地址: http://www.opengl.org/resources/libraries/glut/gl ...
- win10 下visual studio 2015 在调试模式下不能跟踪源文件
win10 下visual studio 2015 在调试模式下不能跟踪源文件,只要一调试就会关闭(隐藏)打开的文档,非常不方便.经过一番折腾,发现是配置的问题. 如果安装多个版本的VS,请删除对应版 ...
- Building OpenCascade on Windows with Visual Studio
Building OpenCascade on Windows with Visual Studio eryar@163.com 摘要Abstract:详细说明OpenCascade的编译配置过程,希 ...
随机推荐
- Sparse Coding: Autoencoder Interpretation
稀疏编码 在稀疏自编码算法中,我们试着学习得到一组权重参数 W(以及相应的截距 b),通过这些参数可以使我们得到稀疏特征向量 σ(Wx + b) ,这些特征向量对于重构输入样本非常有用. 稀疏编码可以 ...
- Spark scheduler
触发Spark scheduler的入口是调用者代码中的action操作,如groupByKey,first,take,foreach等操作.这些action操作最终会调用SparkContext.r ...
- Easy mock - 安装配置和基本使用
Easy-mock easy-mock是一款比较好用的接口模拟工具, 使用之前我们需要安装和配置 需要下载的内容有以下 Node Redis MongoDB Node和Redis一路点下一步就行, M ...
- ReactNavtive框架教程(4)
开头的响应码, 这些代码都很实用. 比如202 和 200表示返回一个推荐位置的列表.当完毕这个实例后.你能够尝试处理这些返回码.并将列表提供给用户选择. 保存,返回模拟器,按下Cmd+R ,然后搜索 ...
- Mysql多实例安装+主从复制+读写分离 -学习笔记
Mysql多实例安装+主从复制+读写分离 -学习笔记 .embody{ padding:10px 10px 10px; margin:0 -20px; border-bottom:solid 1px ...
- Stack switching mechanism in a computer system
A method and mechanism for performing an unconditional stack switch in a processor. A processor incl ...
- manjaro安装virtualbox教程
安装前需要知道 你需要知道你当前的内核版本 uname -r,比如输出了4.14.20-2-MANJARO那么你的内核版本为414 安装VirtualBox sudo pacman -S virtua ...
- Jquery获取select选中的option的文本信息
注意:以下用的$(this)代表当前选中的select框 第一种: $(this).children("option:selec... ...查看全文
- 第二十八天 月出惊山鸟 —Spring的AOP
6月13日,阴转细雨."人闲桂花落.夜静春山空. 月出惊山鸟.时鸣春涧中." 无论在面向过程还是在面向对象里,奇妙的"纯"字,似乎永远都充满了无限的可能性.除了 ...
- animation- 动画效果实现(代码中)
1,首先我们看一下如下的代码 import android.view.animation.LayoutAnimationController; import android.view.animatio ...