matlab与VS2010混合编程时,char16_t redefinition错误
来源:互联网 发布:猎头书籍推荐 知乎 编辑:程序博客网 时间:2024/06/05 11:31
error C2371: 'char16_t' : redefinition; different basic types
在混合编程中,也许会出现如下错误:
—————————————————————————————————————————————————
C:\Microsoft Visual Studio 10.0\VC\INCLUDE\yvals.h(576) : error C2371: 'char16_t' : redefinition; different basic types
C:\Matlab\r2010a\extern\include\matrix.h(330) : see declaration of 'char16_t'
—————————————————————————————————————————————————
原因是VS2010中的yvals.h添加了char16_t的定义,而Matlab的matrix.h也包含对char16_t的定义,所以同时包含这两个头文件的话,会导致重复定义char16_t的错误。
解决方案:
完全没有必要修改这两个头文件(以防修改之后,会在将来导致一些问题),只需要在包含matrix.h之前包含yvals.h即可。例如:
#include <yvals.h>
#if (_MSC_VER >= 1600)
#define __STDC_UTF_16__
#endif
在混合编程中,也许会出现如下错误:
—————————————————————————————————————————————————
C:\Microsoft Visual Studio 10.0\VC\INCLUDE\yvals.h(576) : error C2371: 'char16_t' : redefinition; different basic types
C:\Matlab\r2010a\extern\include\matrix.h(330) : see declaration of 'char16_t'
—————————————————————————————————————————————————
原因是VS2010中的yvals.h添加了char16_t的定义,而Matlab的matrix.h也包含对char16_t的定义,所以同时包含这两个头文件的话,会导致重复定义char16_t的错误。
解决方案:
完全没有必要修改这两个头文件(以防修改之后,会在将来导致一些问题),只需要在包含matrix.h之前包含yvals.h即可。例如:
#include <yvals.h>
#if (_MSC_VER >= 1600)
#define __STDC_UTF_16__
#endif
#include "mex.h"
注:mex.h 包含matrix.h。这就要求我们必须知道所包含的头文件是否包含matrix.h。- matlab与VS2010混合编程时,char16_t redefinition错误
- matlab与VS2010混合编程时,char16_t redefinition错误
- matlab与VS2010混合编程时,char16_t redefinition错误
- matlab与VS2010混合编程时,char16_t redefinition错误
- [转载]matlab与VS2010混合编程时,char16_t redefine
- matlab 2012b与VS2010混合编程
- C#与MATLAB混合编程常见错误
- vs2010和matlab2010混合编程中char16_t重定义的问题
- matlab 2012 vs2010混合编程
- matlab 2012 vs2010混合编程
- matlab与C混合编程调试-vs2010+matlab2012a
- MATLAB R2012a与vs2010混合编程 error LNK2019
- c++与matlab混合编程,vs2010中调用.mat文件
- MATLAB R2012a与vs2010混合编程 error LNK2019
- MATLAB R2012a与vs2010混合编程 error LNK2019
- 记VS2010与MATLAB混合编程遇到的一些问题
- vs2010 matlab混合编程调用matlab引擎
- vs2010和Matlab R2012a 混合编程
- 2003 cant connect to MySQL server on 'localhost'(10061)
- 各大面试题
- 旧工程适配iOS6和iPhone5的一些故事
- CheckBoxList 两列并排 编译为表格显示
- Difference between CPPFLAGS and CXXFLAGS in GNU Make
- matlab与VS2010混合编程时,char16_t redefinition错误
- 模仿和模仿之外
- GRUB - Debian 6 下无/boot/grub/menu.lst
- apache错误:Internal Server Error
- Java高新技术之注解
- 线程模型和Dispatcher
- apache出现You don't have permission to access / on this server. 提示
- Android_4.2_源码下载和编译环境安装及Android_4.2_源码编译
- [Android]ListView小技巧