# Can't compile SDL 1.3 using Visual Studio 2005

**URL:** <https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378>\
**Category:** SDL Development\
**Created:** [June 9, 2009, 1:08pm UTC](https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378 "2009-06-09T13:08:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricardo](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/r/a6a055/32.png) [@Ricardo](https://discourse.libsdl.org/u/Ricardo)\
**Post date:** [June 9, 2009, 1:08pm UTC](https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378/1 "2009-06-09T13:08:10Z")

</div>

Hi friends!

I would like to use SDL 1.3 on Windows. I try to compile it (last snapshoot,  
SDL-1.3.0-4537) and I get a lot errors like this:  
fatal error C1083: Cannot open include file: ‘d3d9.h’: No such file or  
directory  
So, I guess I need DirectX9 SDK, right now I’ll look for it.

Questions:  
Is there any TXT or document with HOWTO compile it and requirements or any  
other instrucciones about compiling 1.3 on VS2005?  
I only want to use OpenGL. Must I still download DX9SDK? (note: I will use a  
joystick)  
On project settings, I don’t see anything regarding directx pahts, should I  
include them? (In the case I have to use it)

That’s all, thanks lot for your time.

---

<div class="post-metadata">

**Author:** ![Paulo\_Pinto](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/p/7cd45c/32.png) [@Paulo\_Pinto](https://discourse.libsdl.org/u/Paulo_Pinto)\
**Post date:** [June 9, 2009, 3:07pm UTC](https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378/2 "2009-06-09T15:07:30Z")

</div>

Have you checked the FAQ?

[http://www.libsdl.org/cgi/docwiki.cgi/FAQ\_Frequently\_Asked\_Questions#head-640a7d4647ada5770da1612da60616e0f65fa127](http://www.libsdl.org/cgi/docwiki.cgi/FAQ_Frequently_Asked_Questions#head-640a7d4647ada5770da1612da60616e0f65fa127)

It speaks about 2003 version, but there are not that many changes between  
both versions.–  
Paulo

On Tue, Jun 9, 2009 at 3:08 PM, Ricardo wrote:

> Hi friends!
> 
> I would like to use SDL 1.3 on Windows. I try to compile it (last  
> snapshoot,  
> SDL-1.3.0-4537) and I get a lot errors like this:  
> fatal error C1083: Cannot open include file: ‘d3d9.h’: No such file or  
> directory  
> So, I guess I need DirectX9 SDK, right now I’ll look for it.
> 
> Questions:  
> Is there any TXT or document with HOWTO compile it and requirements or any  
> other instrucciones about compiling 1.3 on VS2005?  
> I only want to use OpenGL. Must I still download DX9SDK? (note: I will use  
> a  
> joystick)  
> On project settings, I don’t see anything regarding directx pahts, should I  
> include them? (In the case I have to use it)
> 
> That’s all, thanks lot for your time.
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Ricardo](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/r/a6a055/32.png) [@Ricardo](https://discourse.libsdl.org/u/Ricardo)\
**Post date:** [June 15, 2009, 5:17pm UTC](https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378/3 "2009-06-15T17:17:31Z")

</div>

Perhaps this is the closer thread about compiling sdl  
[http://www.libsdl.org/cgi/docwiki.cgi/FAQ\_Compiling\_on\_Microsoft\_Visual\_C%2B%2B\_2005\_Express](http://www.libsdl.org/cgi/docwiki.cgi/FAQ_Compiling_on_Microsoft_Visual_C%2B%2B_2005_Express)  
but it seems it is about SDL 1.2 and links to directx are broken.

Any other guida? Have anybody compiled SDL 1.3 with VS2005 sucessfully?

Thanks a lot for your time.

“Paulo Pinto” escribi? en el mensaje news:969dc8fe0906090807y7e759b03p1799b210989ef277 at [mail.gmail.com](http://mail.gmail.com)…  
Have you checked the FAQ?

[http://www.libsdl.org/cgi/docwiki.cgi/FAQ\_Frequently\_Asked\_Questions#head-640a7d4647ada5770da1612da60616e0f65fa127](http://www.libsdl.org/cgi/docwiki.cgi/FAQ_Frequently_Asked_Questions#head-640a7d4647ada5770da1612da60616e0f65fa127)

It speaks about 2003 version, but there are not that many changes between both versions.–  
Paulo

On Tue, Jun 9, 2009 at 3:08 PM, Ricardo \<@Ricardo\> wrote:

```
Hi friends!

I would like to use SDL 1.3 on Windows. I try to compile it (last snapshoot,
SDL-1.3.0-4537) and I get a lot errors like this:
fatal error C1083: Cannot open include file: 'd3d9.h': No such file or
directory
So, I guess I need DirectX9 SDK, right now I'll look for it.

Questions:
Is there any TXT or document with HOWTO compile it and requirements or any
other instrucciones about compiling 1.3 on VS2005?
I only want to use OpenGL. Must I still download DX9SDK? (note: I will use a
joystick)
On project settings, I don't see anything regarding directx pahts, should I
include them? (In the case I have to use it)

That's all, thanks lot for your time.

_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

```

* * *

* * *

SDL mailing list  
SDL at [lists.libsdl.org](http://lists.libsdl.org)  
[http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![icculus](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/icculus/32/81_2.png) [@icculus](https://discourse.libsdl.org/u/icculus)\
**Post date:** [June 17, 2009, 4:39am UTC](https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378/4 "2009-06-17T04:39:23Z")

</div>

> Any other guida? Have anybody compiled SDL 1.3 with VS2005 sucessfully?

I just tried it, here’s my list of steps:

- Install VS2005 (The free-download Visual C++ Express 2005 works, too).

- Install the latest DirectX SDK from Microsoft:

[http://www.microsoft.com/downloads/details.aspx?FamilyID=24a541d6-0486-4453-8641-1eee9e21b282&displaylang=en](http://www.microsoft.com/downloads/details.aspx?FamilyID=24a541d6-0486-4453-8641-1eee9e21b282&displaylang=en)

- You may have to add it to VS2005 if the DirectX installer didn’t do  
it. In Visual Studio, go to the “Tools” menu, “Options”, “Projects and  
Solutions”, “VC++ Directories”, “Show Directories for:”, “Include files”  
… add “C:\Program Files\Microsoft DirectX SDK (March 2009)\Include”  
(or whatever) to the start of the list if something like that isn’t  
already there. Do the same with “Show directories for: Library Files”,  
adding “Lib\x86” instead of “Include”.

- Check out SDL 1.3 from Subversion, open SDL/VisualC/SDL.sln in VS2005.

- You’ll need to tweak two files in the SDL/include directory, that  
don’t get generated by Visual Studio. Move “SDL\_config\_win32.h” to  
“SDL\_config.h” and make a file called “SDL\_revision.h” that has this line:

- Then, tell Visual Studio to build the solution. It should work.

Rather, it’ll work when the atomic operations patch is fixed, soon.

There is also a “test” solution in there, to build the example  
applications. You can use this to sanity check things.

Some of those steps are a little opaque, but it’s not too hard.

–ryan.

---

<div class="post-metadata">

**Author:** ![Mars\_999](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/mars_999/32/142_2.png) [@Mars\_999](https://discourse.libsdl.org/u/Mars_999)\
**Post date:** [June 17, 2009, 4:52am UTC](https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378/5 "2009-06-17T04:52:35Z")

</div>

I am out of the loop on 1.3v, but are we going to need DX SDK to compile  
and run 1.3 now?

Ryan C. Gordon wrote:\>

> > Any other guida? Have anybody compiled SDL 1.3 with VS2005 sucessfully?
> 
> I just tried it, here’s my list of steps:
> 
> - Install VS2005 (The free-download Visual C++ Express 2005 works, too).
> 
> - Install the latest DirectX SDK from Microsoft:
> 
> [http://www.microsoft.com/downloads/details.aspx?FamilyID=24a541d6-0486-4453-8641-1eee9e21b282&displaylang=en](http://www.microsoft.com/downloads/details.aspx?FamilyID=24a541d6-0486-4453-8641-1eee9e21b282&displaylang=en)
> 
> - You may have to add it to VS2005 if the DirectX installer didn’t do  
> it. In Visual Studio, go to the “Tools” menu, “Options”, “Projects and  
> Solutions”, “VC++ Directories”, “Show Directories for:”, “Include  
> files” … add “C:\Program Files\Microsoft DirectX SDK (March  
> 2009)\Include” (or whatever) to the start of the list if something  
> like that isn’t already there. Do the same with “Show directories for:  
> Library Files”, adding “Lib\x86” instead of “Include”.
> 
> - Check out SDL 1.3 from Subversion, open SDL/VisualC/SDL.sln in VS2005.
> 
> - You’ll need to tweak two files in the SDL/include directory, that  
> don’t get generated by Visual Studio. Move “SDL\_config\_win32.h” to  
> “SDL\_config.h” and make a file called “SDL\_revision.h” that has this  
> line:
> 
> - Then, tell Visual Studio to build the solution. It should work.
> 
> Rather, it’ll work when the atomic operations patch is fixed, soon.
> 
> There is also a “test” solution in there, to build the example  
> applications. You can use this to sanity check things.
> 
> Some of those steps are a little opaque, but it’s not too hard.
> 
> –ryan.
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![icculus](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/icculus/32/81_2.png) [@icculus](https://discourse.libsdl.org/u/icculus)\
**Post date:** [June 17, 2009, 12:41pm UTC](https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378/6 "2009-06-17T12:41:21Z")

</div>

> I am out of the loop on 1.3v, but are we going to need DX SDK to compile  
> and run 1.3 now?

Was there ever a time when you didn’t need the DirectX SDK to build SDL?

–ryan.

---

<div class="post-metadata">

**Author:** ![Pierre\_Phaneuf](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/pierre_phaneuf/32/94_2.png) [@Pierre\_Phaneuf](https://discourse.libsdl.org/u/Pierre_Phaneuf)\
**Post date:** [June 17, 2009, 4:26pm UTC](https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378/7 "2009-06-17T16:26:51Z")

</div>

> > I am out of the loop on 1.3v, but are we going to need DX SDK to compile  
> > and run 1.3 now?
> 
> Was there ever a time when you didn’t need the DirectX SDK to build SDL?

I’m far from a Windows expert, and I didn’t delve into the Win32 parts  
of SDL very much, but now that the default backend on Windows is GDI  
rather than DirectDraw, shouldn’t it be possible to build SDL without  
DirectX? Or does it also use DirectInput, or some other part?On Wed, Jun 17, 2009 at 8:41 AM, Ryan C. Gordon wrote:

–

> **[Pierre Phaneuf's Diary](https://pphaneuf.livejournal.com/)**
>
> pphaneuf - the new blog in LiveJournal. There should be new interesting records soon.

---

<div class="post-metadata">

**Author:** ![Paulo\_Pinto](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/p/7cd45c/32.png) [@Paulo\_Pinto](https://discourse.libsdl.org/u/Paulo_Pinto)\
**Post date:** [June 17, 2009, 8:55pm UTC](https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378/8 "2009-06-17T20:55:22Z")

</div>

As far as I know, you need to customize the build process for it to work, if  
at all.

It is way much easier just to have the proper SDKs in place.-  
Paulo

On Wed, Jun 17, 2009 at 6:26 PM, Pierre Phaneuf wrote:

> On Wed, Jun 17, 2009 at 8:41 AM, Ryan C. Gordon wrote:
> 
> > > I am out of the loop on 1.3v, but are we going to need DX SDK to compile  
> > > and run 1.3 now?
> > 
> > Was there ever a time when you didn’t need the DirectX SDK to build SDL?
> 
> I’m far from a Windows expert, and I didn’t delve into the Win32 parts  
> of SDL very much, but now that the default backend on Windows is GDI  
> rather than DirectDraw, shouldn’t it be possible to build SDL without  
> DirectX? Or does it also use DirectInput, or some other part?
> 
> –  
> [http://pphaneuf.livejournal.com/](http://pphaneuf.livejournal.com/)
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Pierre\_Phaneuf](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/pierre_phaneuf/32/94_2.png) [@Pierre\_Phaneuf](https://discourse.libsdl.org/u/Pierre_Phaneuf)\
**Post date:** [June 17, 2009, 10:11pm UTC](https://discourse.libsdl.org/t/cant-compile-sdl-1-3-using-visual-studio-2005/16378/9 "2009-06-17T22:11:53Z")

</div>

> As far as I know, you need to customize the build process for it to work, if  
> at all.
> 
> It is way much easier just to have the proper SDKs in place.

Ah, right no autoconf there, gotcha…On Wed, Jun 17, 2009 at 4:55 PM, Paulo Pinto wrote:

–

> **[Pierre Phaneuf's Diary](https://pphaneuf.livejournal.com/)**
>
> pphaneuf - the new blog in LiveJournal. There should be new interesting records soon.
