在ubuntu 16.04编译神经网络代码时候,遇到了这样一种错误?

fatal error: SDL/SDL.h: No such file or directory

   原因是SDL库没有安装,根据你使用的是SDL1还是SDL2来进行不同的安装:如下所示:

  • SDL2

    sudo apt-get install libsdl2-dev
  • SDL1

    sudo apt-get install libsdl1.2-dev

SDL库是什么?这个估计很多人都没有听过吧,包括我。就顺便学习一下吧。看一下wiki:

  SDL(Simple DirectMedia Layer)是一套開放原始碼跨平台多媒體開發函式庫,使用C語言寫成。SDL提供了數種控制圖像、聲音、輸出入的函式,讓開發者只要用相同或

是相似的程式碼就可以開發出跨多個平台(LinuxWindowsMac OS X等)的應用軟體。目前SDL多用於開發游戏模拟器媒體播放器等多媒體應用领域。

  SDL(第一版)使用GNU宽通用公共许可证為授權方式,意指動態連結(dynamic link)其函式庫並不需要開放本身的原始碼。因此諸如《雷神之鎚4》等商業遊戲也使用SDL來開發。

而第二版的SDL則改用Zlib授权來授權。

  使用例子:

  

// Headers
#include "SDL.h" // Main function
int main(int argc, char* argv[])
{
// Initialize SDL
if(SDL_Init(SDL_INIT_EVERYTHING) == -)
return(); // Delay 2 seconds
SDL_Delay(); // Quit SDL
SDL_Quit(); // Return
return ;
}

  上面的代码编译运行,就知道系统SDL是否安装成功了。

 参考文档:

1 https://zh.wikipedia.org/wiki/SDL

ubuntu16.04 编译出错:fatal error: SDL/SDL.h: No such file or directory的更多相关文章

  1. 全志TinaLinux编译错误fatal error: unicode/ucnv.h: No such file or directory

    今天开始正式干活了 拿到一个全志Tina的板子还有一个SDK压缩包,要求我这周(只剩一天半...)就要把sdk编译通过并且把板子跑起来. 还特别跟我说他们试了下这个sdk编译没法通过,会报错... 竟 ...

  2. 解决Ubuntu16.04 fatal error: json/json.h: No such file or directory

    参考博客 错误产生 安装json-c库之后,根据GitHub上面的readme文件链接到json-c库时出现以下错误: SDMBNJson.h:9:23: fatal error: json/json ...

  3. 【Redis】编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory

    [Redis]编译错误zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory 在安装redis进行编译 ...

  4. 编译内核时出现drivers/mfd/mxc-hdmi-core.c:36:24: fatal error: mach/clock.h: No such file or directory

    在学习恩智浦IMX6D开发板时,编译内核出现 drivers/mfd/mxc-hdmi-core.c::: fatal error: mach/clock.h: No such file or dir ...

  5. cocos2d-x 移植到android中编译的一些问题:fatal error: Box2D/Box2D.h: No such file or directory"

    1.fatal error: Box2D/Box2D.h: No such file or directory" 须要加入box2d库的支持,改动android.mk文件,例如以下: 查看文 ...

  6. fatal error: sys/videoio.h: No such file or directory

    Determining if the include file sys/videoio.h exists failed with the following output:Change Dir: /h ...

  7. lua.c:82:10: fatal error: readline/readline.h: No such file or directory #include <readline/readline.h>

    make linuxcd src && make linuxmake[1]: Entering directory `/root/lua/lua-5.3.2/src'make all ...

  8. fatal error: openssl/sha.h: No such file or directory 解决方案

    出现这个或者fatal error: openssl/名单.h: No such file or directory.都是没有安装libssl-dev- libssl-dev包含libraries, ...

  9. lua.c:80:31: fatal error: readline/readline.h: No such file or directory

    make linuxcd src && make linuxmake[1]: Entering directory `/root/lua/lua-5.3.2/src'make all ...

  10. msgsrvmgr.cpp:5:37: fatal error: kdl_conversions/kdl_msg.h: No such file or directory #include <kdl_conversions/kdl_msg.h>

    /home/xxx/ros_workspace/src/bp_protocol_bridge/protospot/src/msgsrvmgr.cpp::: fatal error: kdl_conve ...

随机推荐

  1. JVM系列2:垃圾收集器与内存分配策略

    垃圾收集是一个很大话题,本文也只是看了深入理解Java虚拟机总结了下垃圾收集的知识. 首先按照惯例,先上思维导图: 垃圾收集简而言之就是JVM帮我们清理掉内存区域不需要的数据.它主要负责清理堆中实例对 ...

  2. myeclise 安装

    安装.破解步骤都在gaobo百度云/工具/开发工具 安装后配置环境变量:

  3. 数据库启动windows

    1.上 MongoDB官网下载数据库,下载之后选择自己想放的文件夹要记住文件夹位置,比如我下载之后就放在D盘,改文件夹为 mongodb 2.启动之前要给mongodb指定一个文件夹,这里取名为&qu ...

  4. OpenStack 安装:keystone服务

    在前面的章节里面,我们配置了基本环境,也安装keystone服务,并且创建了keystone的数据库,在这一篇里面,我们说怎么配置keystone. 首先编辑keystone服务,需要修改如下数据 编 ...

  5. iOS之Safari调试webView/H5页面

    之前做过混合开发,用的是JavaScriptCore+OC+UIWebView. Safari调试功能真的很有用,通过它可以轻松定位问题的所在,下面说说怎么调试. 开启Safari开发菜单 在Mac的 ...

  6. 528. Random Pick with Weight index的随机发生器

    [抄题]: Given an array w of positive integers, where w[i] describes the weight of index i, write a fun ...

  7. Add custom field in Material Master

    1.Add fields in the Append Structure of table MARA. 2.Configure SPRO IMG -> Logistics General -&g ...

  8. 使用jmail发送短信

    原文链接 https://blog.csdn.net/sdaujsj1/article/details/79248469 pom <!-- https://mvnrepository.com/a ...

  9. 解决安装xcode后git使用报错的问题

    一.现象: htmlxdeMacBook-Pro:demo htmlx$ git status Agreeing to the Xcode/iOS license requires admin pri ...

  10. jquery 表单校验

    <link type="text/css" href="<%=basepath%>css/form/validate.css" rel=&qu ...