tinybind学习一
2015-12-23 14:48
351 查看
tinybind 简介
add-on library for the cross-platform XML parser tinyxml that makes it easy to "bind" a C++ struct definition to an XML file format for easy serialize/deserialize. supports nested structs and STL containers.源码地址
tinybind 编译
由于tinybind好多年没人维护了,编译时出现了多出错误。在linux下编译时,出现了以下错误:
1、tinybind/tinybind.h:222: error: there are no arguments to 'params' that depend on a template parameter, so a declaration of 'params' must be available [-fpermissive]
错误原因查看:参考文档
解决方法:在 IMemberHolder<T>的报错子类中添加:
using IMemberHolder<T>::tag;
using IMemberHolder<T>::params;
2、tinybind/tinytest.cpp:27: error: specializing member '::GetTiXmlBinding<MyData>' requires 'template<>' syntax TiXmlBinding<MyData> const *
解决方法:
TiXmlBinding<MyData> const *
GetTiXmlBinding<MyData>( MyData const &, Identity<MyData> )
改为
TiXmlBinding<MyData> const *
GetTiXmlBinding( MyData const &, Identity<MyData> )
3、tinybind/tinybind.h:276: error: 'stricmp' was not declared in this scope
if( !stricmp(elem.Value(), tag()) ) {
解决方法: stricmp改为strcmp
4、tinybind/tinybind.h:324: error: 'ConvertFromString' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
ConvertFromString( attributeValue, &mv );
tinybind/tinybind.h:335: error: 'ConvertToString' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
char const * attributeValue = ConvertToString( mv );
^ ^
解决方法:
由于void ConvertFromString( char const * strIn, T * dataOut );
char const * ConvertToString( T const & t );
申明在调用者的后面,所以讲这两个申明放到前面就可以了
相关文章推荐
- 前言,学习ios编程(坚持)
- 作业8: 软件工程学习总结
- 一张图告诉你,只会这些HTML还远远不够!!!!!
- python栈的实现(入栈,出栈)
- Android 图片缩放汇总
- Android中日志工具的使用
- GIT 使用记录
- 《近匠》Worktile王涛:典型MEAN架构下的团队协作工具
- Android list去除重复或添加时去掉重复数据
- Java中二维数组和一维数组的clone
- 进入docker容器之nsenter
- Xcode7之空工程(Empty Application)
- QT连接MYSQL数据库
- linux修改文件权限命令chown、chmod、chgrp
- js获取日期:前天、昨天、今天、明天、后天
- win7 64位 TortoiseSVN-1.8.4客户端安装
- JBoss Wildfly (1) —— 7.2.0.Final编译
- Linux——Linux网络基础配置
- C#System.Diagnostics.Process使用例示
- Interllij idea Tomcat 内存调优