VC编译错误:'waveformat_tag' : 'struct' type redefinition
来源:互联网 发布:1分钟的自我介绍 知乎 编辑:程序博客网 时间:2024/05/17 23:16
错误信息:
: error C2011: 'waveformat_tag' : 'struct' type redefinition
: error C2011: 'pcmwaveformat_tag' : 'struct' type redefinition
: error C2061: syntax error : identifier 'LPCWAVEFORMATEX'
: error C2061: syntax error : identifier 'LPCWAVEFORMATEX'
解决方法:
这是头文件包含顺序不正确所致。原先的文件包含顺序为:
#include <mmreg.h>
#include <mmsystem.h>
#include <msacm.h>
可以看到,mmreg.h文件中有如下定义:
#ifndef WAVE_FORMAT_PCM
typedef struct waveformat_tag ××××
而WAVE_FORMAT_PCM在mmsystem.h中有定义,但是在#include <mmreg.h>之前,WAVE_FORMAT_PCM还是没有被定义,所以,typedef struct waveformat_tag ××××语句生效,之后mmsystem.h中再次定义waveformat_tag,于是出现重复定义。
正确的包含顺序是:
#include <mmsystem.h>
#include <mmreg.h>
#include <msacm.h>
(包含静态库)
#pragma comment(lib, "winmm.lib")
#pragma comment(lib, "Msacm32.lib")
- VC编译错误:'waveformat_tag' : 'struct' type redefinition
- VC编译错误:'waveformat_tag' : 'struct' type redefinition
- 'struct' type redefinition
- error C2011: 'fd_set' : 'struct' type redefinition的错误处理
- 'struct' type redefinition
- error C2011: 'fd_set' : 'struct' type redefinition问题
- error C2011: '_INTERFACE_INFO' : 'struct' type redefinition
- error C2011: 'fd_set' : 'struct' type redefinition 。。。
- error C2011: 'ip_mreq' : 'struct' type redefinition
- Keil编译错误Error:Redefinition
- error C2011: 'fd_set' : 'struct' type redefinition的解决方法
- 解决error C2011: 'fd_set' : 'struct' type redefinition问题
- 解决error C2011: 'fd_set' : 'struct' type redefinition的方法
- error C2011: 'fd_set' : 'struct' type redefinition 的原因(转)
- 解决error C2011: 'fd_set' : 'struct' type redefinition的方法
- 解决error C2011: 'fd_set' : 'struct' type redefinition的方法
- C++ Error:C2011: 'struct' type redefinition的一般处理方法
- 解决error C2011: 'fd_set' : 'struct' type redefinition的方法
- 随机函数的rand、srand用法
- 写在工作一个周后
- spring 注入问题
- c#.net常用函数列表
- Jquery学习笔记(二)
- VC编译错误:'waveformat_tag' : 'struct' type redefinition
- 企业网站的主要功能
- 文件读写
- 第二次学到的东西
- C语言中的文件包含
- MyMoviePlayerController.h 播放器
- EclipsePHP 快捷键大全
- MBA的简介
- 15551