使用SDL_Mixer写例程,程序才到初始化就进行不下去了,代码如下:

int nFlag=MIX_INIT_MP3;
   int nRet=Mix_Init(nFlag);
   if(nRet&nFlag!=nFlag)
      return false;

报错信息是:

‘MIX_INIT_MP3’ was not declared in this scope

NND,按官方手册写的代码也报错?还是低级错。这不是坑爹吗?在SDL_Mixer.h里找了半天也没有关于MIX_INIT_MP3和Mix_Init的声明,什么情况?

放狗一查,果然有倒霉孩子和我一样,原文如下:

“I just noticed that on my Ubuntu 9.10 system, the SDL 1.2.8 version of SDL_mixer does not define Mix_Init() or Mix_Quit(). However with SDL 1.2.10, it does. Here's the SDL_mixer.h header file with version 1.2.10:
http://svn.euclids-dream.com/repos/g...DL/SDL_mixer.h ”

大意是利用UBUNTU9.10新立得软件包管理器安装的SDL_mixer是1.2.8版,而Mix_Init和MIX_INIT_MP3出现在1.2.10版中。原文中还给出了1.2.10版SDL_mixer.h的查看地址。

签于本人用的是UBUNTU10.04,于是乎赶紧查了一下本机的SDL_mixer版本,果然也是1.2.8版。问题找到后就好解决了,删除这段代码,直接Mix_OpenAudio,照样能加载播放MP3文件。

转载于:https://www.cnblogs.com/lykyl/archive/2011/05/06/2038430.html

‘MIX_INIT_MP3’ was not declared in this scope,这是什么情况?相关推荐

  1. 【C++】mingw32-make+cmake:error: ‘nullptr‘ was not declared in this scope解决方法

    ###问题 使用cmake成功(Configuring done Generating done)后,在cmd终端中执行 mingw32-make报错: error: 'nullptr' was no ...

  2. ndk error: malloc was not declared in this scope

    error: 'malloc' was not declared in this scope 解决方法: NDK_TOOLCHAIN_VERSION=4.8 APP_CPPFLAGS += -frtt ...

  3. 'imread' was not declared in this scope

    在opencv3中,会报这个异常: 'imread' was not declared in this scope 解决方法: #include <opencv2/core/core.hpp&g ...

  4. 'htons' was not declared in this scope 解决

    'htons' was not declared in this scope ndk 如果是在ndk下,引用如下即可: /* Must include in android ndk env */ #i ...

  5. 解决Cygwin编译cocos2dx 遇到的 error: 'UINT64_C' was not declared in this scope 问题

    环境工具:Win10.VS2013.cocos2d-x-2.2.6.Cygwin.ADT 问题来源:写了一个小游戏,VS2013上运行成功,就尝试着打包apk,项目导入到ADT里面,添加了cocos2 ...

  6. 调用ffmpeg库编译时出现common.h:175:47: error: 'UINT64_C' was not declared in this scope

    解决办法 出现错误:jni/ffmpeg/libavutil/common.h:175:47: error: 'UINT64_C' was not declared in this scope 解决: ...

  7. ‘close’ was not declared in this scope

    'close' was not declared in this scope 'read' was not declared in this scope 'sysconf' was not decla ...

  8. 文档源代码opencv 中的错误error: ‘SurfFeatureDetector’ was not declared in this scope

    本篇文章朋友在青岛游玩的时候突然想到的...最近就有想写几篇关于文档源代码的文章,所以回家到之后就奋笔疾书的写出来发布了     这是文档中的源代码,:但是译编的时候会有一下错误:     error ...

  9. was not declared in this scope

    "was not declared in this scope"是一个错误信息,在编译的时候会遇到.其含义为标识符在其出现的地方是未被定义的. 出现该错误的时候,会同时把未定义的变 ...

最新文章

  1. MPB:中国地大侯卫国组-​ 针对热泉原位培养矿物的低质量DNA提取方法
  2. webpack4.0--如何安装和配置(一)
  3. python 类属性及限制
  4. 音视频技术开发周刊 | 215
  5. Python小练习2:pandas.Dataframe使用方法示例demo
  6. 消息称京东方通过苹果认证 本月开始向iPhone 12供货OLED面板
  7. c 调用matlab.m文件,ubuntu系统下C++调用matlab程序的方法详解
  8. HDOJ水题集合11:桶排序, 折半搜索
  9. 树莓派保持网络连接shell脚本
  10. android gpio 驱动,[RK3288][Android6.0] 调试笔记 --- 通用GPIO驱动控制LED【转】
  11. 简说阿里云服务器搭建与简单项目部署
  12. Python入门(3)
  13. uniapp中使用阿里云视频点播功能
  14. 详解ZStack Cloud v4.0:自研VPC网络模型实践指南
  15. windows下延时函数
  16. 用什么命令确定linux系统,在Linux系统中有哪些命令可以用于查看进程?
  17. AD软件生成gerb文件方法参考
  18. 华科再次拿下华为“天才少年”最高薪!201万给到通信应届博士生
  19. 解决Error in file(con, “w“) : cannot open the connection问题
  20. 无法加载java插件_向各位牛人请教:正常安装的Java,浏览器却不能加载插件怎么办?...

热门文章

  1. metasploit mysql_Metasploit渗透测试:选择模块
  2. linux voip客户端,linux搭建VOIP
  3. html radio 更换图片,html修改radio、checkbox样式
  4. NYOJ-阶乘之和(贪心)
  5. C++:vs2017编写代码时的光标变成了黑块,选中字时替换掉了黑块选中的字【解决办法】
  6. 目标检测中的正负样本
  7. C++ Qt 访问权限总结
  8. 【带着canvas去流浪(5)】绘制K线图
  9. webrequest HttpWebRequest webclient/HttpClient
  10. 图像类似度測量与模板匹配总结