FROM:http://lazyfoo.net/tutorials/SDL/06_extension_libraries_and_loading_other_image_formats/windows/msvsnet2010u/index.php

Setting up SDL Extension Libraries on Visual Studio 2010 Ultimate

Last Updated 7/13/14

1)First thing you need to do is download SDL_image headers and binaries. You will find them on the SDL_image website, specifically on this page.

You'll want to download the visual c++ development libraries.

2)Open the zip archive and there should be a folder that contains folders called include and another one called lib. Copy the contents of the folder and put them where you want. I recommend putting them in the same directory where you put your SDL install. For these tutorials I'm putting them in a directory I created called C:\vs_dev_lib

3)Open your SDL project and go to project properties.

4)Now we have to tell Visual C++ to search for header files in the SDL extension include folder we just extracted. Under Configuration Properties in the VC++ Directories menu, select the Include Directories field, click the tiny down arrow button, and click edit.

5)Click the folder icon, and then click the button that pops up.

6)Now go find the SDL_image (or SDL_ttf/SDL_mixer) folders you extracted, and select the include folder and click OK.

Now Visual Studio knows where to find the header files. If you get an error that the compiler can't find SDL_image.h (or SDL_ttf.h/SDL_mixer.h), it means you messed up this step.

You may have noticed that the directory added here is the same from the setting up SDL tutorial. This is because I over wrote the include directory so it has both the headers from SDL 2 and SDL_image/SDL_ttf/SDL_mixer headers are in the same directory. If you did this you can skip this step because our project already knew where to find the header files. Some prefer keep their SDL and SDL extension libaries in different directories, some prefer them in the same directory. Your choice.

7)Next we're going to tell Visual C++ to search for library files in the SDL_image/SDL_ttf/SDL_mixer library folder we just extracted. Select the Library Directories field, click the tiny down arrow button, and click edit.

8)Click the folder icon, and then click the button that pops up.

9)Now go find the lib folder you extracted, and select the lib folder where you find two folders. There's one for 32bit x86 architecture and for 64bit x64 architecture.

This is important: most compilers still compile 32bit binaries by default to maximize compatibility. We will be using the 32bit binaries for this tutorial set. It doesn't matter if you have a 64bit operating system, since we are compiling 32bit binaries we will be using the 32bit library. This means you need to select the x86 folder and click ok. Now Visual Studio knows where to find the library files. If you get an error how the linker can't find SDL2_image.lib/SDL2_ttf.lib/SDL2_mixer.lib, it means you missed this step.

Like before, you might notice that the lib directory is the same from tutorial 01. Again, this is because I personally like to put the library files for SDL, SDL_image, SDL_ttf, and SDL_mixer in the same directory. If you do this you can skip this step since visual studio is already looking for library files there. For you people you put them in a separate directory, you need to tell visual studio where to find the lib files.

10)In order to compile SDL code, we have to tell the Visual C++ to link against the libraries. Go under Linker in the Input menu, edit the additional dependencies.

11)Now paste

SDL2_image.lib;
into the Additional dependencies field and click OK.

If you were linking SDL_ttf, you'd put SDL2_ttf.lib. If you were linking SDL2_mixer, you'd put SDL2_mixer.lib.

Now Visual Studio knows to link against the extension library. If you get a bunch of undefined reference error after compiling, it means you messed up this step.

12)Like with plain SDL, the operating system needs to be able to find the dll files for the extension library while running.

Go find the lib folder you extracted from the extension library and copy all of the dll files and put them either your project's working directory (where the vcxproj file is at), or inside of the system directory. C:\WINDOWS\SYSTEM32 is the 32bit windows system directory and C:\Windows\SysWOW64 is the 64bit system directory of 32bit applications. For these tutorials, I'm assuming we're making 32bit applications.

13)Now go download the source for lesson 06. Add the source file inside to your project.

Now build. If there are any errors, make sure you didn't skip a step.

Now that you have the extension library compiling, it's time to go onto part 2 of the tutorial.

【转】Setting up SDL Extension Libraries on Visual Studio 2010 Ultimate的更多相关文章

  1. 【转】Setting up SDL Extension Libraries on Visual Studio 2019 Community

    FROM:http://lazyfoo.net/tutorials/SDL/06_extension_libraries_and_loading_other_image_formats/windows ...

  2. 【转】Setting up SDL Extension Libraries on Windows

    FROM: http://lazyfoo.net/tutorials/SDL/06_extension_libraries_and_loading_other_image_formats/window ...

  3. 【转】Setting up SDL Extension Libraries on MinGW

    FROM:http://lazyfoo.net/tutorials/SDL/06_extension_libraries_and_loading_other_image_formats/windows ...

  4. 【转】Setting up SDL Extension Libraries on Code::Blocks 12.11

    FROM: http://lazyfoo.net/tutorials/SDL/06_extension_libraries_and_loading_other_image_formats/window ...

  5. 【转】Setting up SDL 2 on Visual Studio 2010 Ultimate

    from: Lazy Foo'Productions - Setting up SDL 2 on Visual Studio 2010 Ultimate 1)First thing you need ...

  6. Visual Studio 2010 更新NuGet Package Manager出错解决办法

    在Visual Studio 2010的扩展管理器中发现NuGet Package Manger有最新版本更新提示,选择更新安装提示以下错误信息: 2013/4/25 1:11:48 - Micros ...

  7. Visual Studio 2010 简体中文旗舰、专业版(MSDN原版下载)

    Visual Studio 2010 简体中文旗舰.专业版(MSDN原版下载)(Visual Studio 2010 ultimate professional x86 dvd)2010[光盘镜像]- ...

  8. visual studio 2010 破解版 破解方法

    1.Microsoft Visual Studio 2010下载(均来自微软官网) 高级版(Premium) [建议下载]       http://download.microsoft.com/do ...

  9. 《转》Visual Studio 2010 终极定制安装精简方法

    打开VS2010安装目录下的 Setup 文件夹,找到 baseline.dat 文件和 vs_setup.pdi 文件还有一个 locdata.ini 文件,是对应的. 这些都是文本文件,用记事本就 ...

随机推荐

  1. 【Processing-日常3】等待动画1

    之前在CSDN上发表过: https://blog.csdn.net/fddxsyf123/article/details/79755976

  2. macOS提示“将对您的电脑造成伤害……“进阶版

    > 很多小伙伴在更新完系统后运行应用会闪退以及提示"xxxx 将对您的电脑造成伤害. 您应该将它移到废纸篓",本文将针对此问题提供解决方法.如图:![-w456](https ...

  3. 线上Redis高并发性能调优实践

    项目背景 最近,做一个按优先级和时间先后排队的需求.用 Redis 的 sorted set 做排队队列. 主要使用的 Redis 命令有, zadd, zcount, zscore, zrange ...

  4. 欧拉函数线性求解以及莫比乌斯反演(Mobius)

    前言 咕咕了好久终于来学习莫反了 要不是不让在机房谁会发现数学一本通上有这么神奇的东西 就是没有性质的证明 然后花了两节数学课证明了一遍 舒服- 前置知识:欧拉函数,二项式定理(组合数) 会欧拉函数的 ...

  5. zeroc ICE 使用案例

    此处案例将ICE接口当做单servant使用(ICE自带端口复用的多servant,过于复杂,此处不讨论) 使用ICE较为方便的地方时 可以编写 ice中间代码,然后由官方工具转换为目标平台代码(通过 ...

  6. MySQL 5.7主从复制

    简介 主从复制是利用MySQL复制机制将数据复制到另外一台或多台MySQL服务器上,被复制的服务器称为主服务器,复制的服务器称为从服务器.一般是一主多从.主从复制的好处主要是数据备份.负载均衡(读写分 ...

  7. 从面向过程到面向对象再到MVC

    /* * * title: 从面向过程到面向对象再到MVC * author: tanghao * date: 2020.9.30 * version: 1.0 * */ 前言 本文档通过一个显示20 ...

  8. 《穷查理年鉴》诚实 & 希望 & 勇气 & 失败 & 改变(关于美好)

    诚实 013.自欺是最常见的欺骗. 038.毫无顾忌进行欺骗的人是无所畏惧的. 043.问心无愧者永无所惧. 068.诚实的人从欺诈人手中得到的买卖,我们从争论中得到真理. 134.没有欺骗就没有信任 ...

  9. CSG:清华大学提出通过分化类特定卷积核来训练可解释的卷积网络 | ECCV 2020 Oral

    论文提出类特定控制门CSG来引导网络学习类特定的卷积核,并且加入正则化方法来稀疏化CSG矩阵,进一步保证类特定.从实验结果来看,CSG的稀疏性能够引导卷积核与类别的强关联,在卷积核层面产生高度类相关的 ...

  10. 《New Horizon College English》2--长篇阅读技能指南

    <New Horizon College English>2--长篇阅读技能指南 <长篇阅读>目的是提升学生的英语阅读技能和限时获取信息的能力.<长篇阅读>共四级, ...