【转】Setting up SDL Extension Libraries on Visual Studio 2010 Ultimate
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;
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的更多相关文章
- 【转】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 ...
- 【转】Setting up SDL Extension Libraries on Windows
FROM: http://lazyfoo.net/tutorials/SDL/06_extension_libraries_and_loading_other_image_formats/window ...
- 【转】Setting up SDL Extension Libraries on MinGW
FROM:http://lazyfoo.net/tutorials/SDL/06_extension_libraries_and_loading_other_image_formats/windows ...
- 【转】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 ...
- 【转】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 ...
- Visual Studio 2010 更新NuGet Package Manager出错解决办法
在Visual Studio 2010的扩展管理器中发现NuGet Package Manger有最新版本更新提示,选择更新安装提示以下错误信息: 2013/4/25 1:11:48 - Micros ...
- Visual Studio 2010 简体中文旗舰、专业版(MSDN原版下载)
Visual Studio 2010 简体中文旗舰.专业版(MSDN原版下载)(Visual Studio 2010 ultimate professional x86 dvd)2010[光盘镜像]- ...
- visual studio 2010 破解版 破解方法
1.Microsoft Visual Studio 2010下载(均来自微软官网) 高级版(Premium) [建议下载] http://download.microsoft.com/do ...
- 《转》Visual Studio 2010 终极定制安装精简方法
打开VS2010安装目录下的 Setup 文件夹,找到 baseline.dat 文件和 vs_setup.pdi 文件还有一个 locdata.ini 文件,是对应的. 这些都是文本文件,用记事本就 ...
随机推荐
- 基础篇:深入解析JAVA反射机制
目录 反射的概念 获取Class的三种方法 JAVA反射API 反射机制应用的场景 反射和JDK动态代理 欢迎指正文中错误 关注公众号,一起交流 参考文章 反射的概念 java的放射机制:在程序运行时 ...
- 你可能不知道的 Date 类
Date 是 JS 中的重要的一个内置对象,其实例主要用于处理时间和日期,其时间基于 1970-1-1 (世界标准时间)起的毫秒数,时间戳长度为 13 位(不同于 Unix 时间戳的长度 10 位). ...
- Android小部件Widget开发过程中的坑和总结
@ 目录 概述 官方参考 效果图 AndroidManifest.xml Receiver Service Options res/xml/ widget_desktop_options.xml 常用 ...
- Python数据结构与算法之图的最短路径(Dijkstra算法)完整实例
本文实例讲述了Python数据结构与算法之图的最短路径(Dijkstra算法).分享给大家供大家参考,具体如下: # coding:utf-8 # Dijkstra算法--通过边实现松弛 # 指定一个 ...
- MySQL中事务和事务的隔离级别
本文主要是帮助理解相关知识,没有具体的操作和代码. 事务 事务就是一组操作,这组操作要么全部成功,要么全部失败. 最经典的例子就是银行转账: 张三给李四转账100,对用户来说,就是一个操作.但对应到数 ...
- Java安全之Commons Collections1分析(一)
Java安全之Commons Collections1分析(一) 0x00 前言 在CC链中,其实具体执行过程还是比较复杂的.建议调试前先将一些前置知识的基础给看一遍. Java安全之Commons ...
- Java变量命名前俩个字母仅含有一个大写字母的坑
背景 前几周在做项目fetch切换,即将HttpUtils调用改成使用Feign调用.大概代码如下: // 原代码 String resultJson = HttpUtil.get(url + &qu ...
- ie 版本判断脚本
// 获取IE版本 /** * @return {string} */ function IEVersion() { // 取得浏览器的userAgent字符串 var userAgent = nav ...
- Git命令diff格式详解
diff是Unix系统的一个很重要的工具程序. 它用来比较两个文本文件的差异,是代码版本管理的基石之一.你在命令行下,输入: $ diff <变动前的文件> <变动后的文件> ...
- 极简 Node.js 入门 - 5.2 url & querystring
极简 Node.js 入门系列教程:https://www.yuque.com/sunluyong/node 本文更佳阅读体验:https://www.yuque.com/sunluyong/node ...