12 Replies - 2246 Views - Last Post: 02 October 2011 - 11:33 AM Rate Topic: -----

#1 newn  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 119
  • Joined: 22-April 09

Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 04:54 AM

Cannot open include file: 'dxstdafx.h': No such file or directory

I'm getting this error when trying to compile a code related to DirectSound. I'm using VS 2010 Express along with DirectX SDK from June, 2010.

My guess is that there were some changes to this, as I already had to change dxerr9 to dxerr.
How can I fix this error?
Is This A Good Question/Topic? 0
  • +

Replies To: Cannot open include file: 'dxstdafx.h': No such file or direct

#2 Adak  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 331
  • View blog
  • Posts: 1,168
  • Joined: 01-April 11

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 05:06 AM

C++ doesn't use the dot h at the end of their include files, anymore. See if you don't have the include file, minus the dot h. (and change your listing to agree with the new name, of course)
Was This Post Helpful? 0
  • +
  • -

#3 newn  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 119
  • Joined: 22-April 09

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 05:11 AM

No, it doesn't compile, nor I am able to find this file.
Was This Post Helpful? 0
  • +
  • -

#4 Bench  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 856
  • View blog
  • Posts: 2,339
  • Joined: 20-August 07

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 05:24 AM

View PostAdak, on 02 October 2011 - 01:06 PM, said:

C++ doesn't use the dot h at the end of their include files, anymore. See if you don't have the include file, minus the dot h. (and change your listing to agree with the new name, of course)

dxstdafx.h is not a standard C++ include file however. Judging by the OP, it sounds like it belongs to the DirectX SDK
Was This Post Helpful? 0
  • +
  • -

#5 newn  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 119
  • Joined: 22-April 09

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 05:27 AM

Yes, I am learning about DirectX sound from some great tutorials back from 2007.
I guess the file either was renamed or merged in the newer Dx version, however I was unable to find any information about it...
Was This Post Helpful? 0
  • +
  • -

#6 Bench  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 856
  • View blog
  • Posts: 2,339
  • Joined: 20-August 07

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 05:37 AM

View Postnewn, on 02 October 2011 - 01:11 PM, said:

No, it doesn't compile, nor I am able to find this file.
Perhaps a silly question, Did you search the entire SDK folder, including all subfolders? Are you sure that you've installed the SDK correctly?

If you're 100% certain that the missing, and the documentation you've got says that file should exist, then that suggests either something went wrong during installing it (or perhaps you missed out a step?), or maybe that you're using a different version of the SDK compared to the one which goes with the documentation

View Postnewn, on 02 October 2011 - 01:27 PM, said:

Yes, I am learning about DirectX sound from some great tutorials back from 2007.
I guess the file either was renamed or merged in the newer Dx version, however I was unable to find any information about it...

That could explain it. I have no idea what version of DirectX existed in 2007 (And perhaps the tutorials weren't even for the latest version at the time? Maybe it'll tell you what version it had been written for).

I expect the easiest thing for you to do will be to either use the SDK version which matches the tutorials, or find a tutorial for the newer version; SDKs do have a habit of changing between software versions (it's not uncommon to pick up a new SDK for something and find that its incompatible with the older version) - You might find that there are other changes in the latest version which causes problems following the older tutorial.
Was This Post Helpful? 0
  • +
  • -

#7 newn  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 119
  • Joined: 22-April 09

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 05:48 AM

View PostBench, on 02 October 2011 - 03:37 PM, said:

That could explain it. I have no idea what version of DirectX existed in 2007 (And perhaps the tutorials weren't even for the latest version at the time? Maybe it'll tell you what version it had been written for).

I expect the easiest thing for you to do will be to either use the SDK version which matches the tutorials, or find a tutorial for the newer version; SDKs do have a habit of changing between software versions (it's not uncommon to pick up a new SDK for something and find that its incompatible with the older version) - You might find that there are other changes in the latest version which causes problems following the older tutorial.


There is a big problem in finding newer tutorials, especially for a whole game engine. That was the newest I could find, so I took it. I also don't really want to use an older Dx version - it's out-dated. Using outdated stuff usually leads to misuse of newer code and other problems, that's why I always try to stay up-to-date.

Learning parts and then putting everything together when it's not explained well... Well, it's not something I can do, nor most beginners in this section could do, I believe.

Although, if you could point me to some tutorials for this matter (without the use of any external libraries, like Allegro (which I absolutely hate, by the way)), it would be awesome, but I haven't found anything newer in two hours of surfing when I was looking for a reference on this matter.
---
As for other problems - everything seems to be working fine. Only input and tile-scrolling is left for me to go trough, and I doubt anything is changed in these as I skimped trough the code a few minutes ago. Input might have a problem, but not likely, as it haven't changed since Dx8 according to the author, so it's not likely that suddenly something would be changed in July of 2010 either... At least that's my opinion and understanding of this whole matter.

This post has been edited by newn: 02 October 2011 - 05:51 AM

Was This Post Helpful? 0
  • +
  • -

#8 Bench  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 856
  • View blog
  • Posts: 2,339
  • Joined: 20-August 07

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 07:11 AM

View Postnewn, on 02 October 2011 - 01:48 PM, said:

There is a big problem in finding newer tutorials, especially for a whole game engine. That was the newest I could find, so I took it. I also don't really want to use an older Dx version - it's out-dated. Using outdated stuff usually leads to misuse of newer code and other problems, that's why I always try to stay up-to-date.
Just to clarify - are you trying to compile a Game Engine or are you trying to compile an example program just to get something from within the DirectX SDK to work?

If you're working with the codebase of an existing Game Engine, then you might not have any choice if the game engine you're using does not support the latest SDK (I suspect that it doesn't if you're getting trouble compiling it). I also suspect that if you do get it compiling, then you might get other "weird" problems when its actually running, because there may be other incompatibilities that the compiler doesn't pick up (And these will probably be hard to diagnose and fix).

Also, regardless of the version you actually run on your system, remember that your tutorial was written in 2007 - so whatever it's teaching you will be the techniques which were (hopefully) correct for 2007, so you're unlikely to be learning anything newer anyway.


View Postnewn, on 02 October 2011 - 01:48 PM, said:

Although, if you could point me to some tutorials for this matter (without the use of any external libraries, like Allegro (which I absolutely hate, by the way)), it would be awesome, but I haven't found anything newer in two hours of surfing when I was looking for a reference on this matter.
I'm not a DirectX programmer so I don't know of any myself, although I have had to work with a number of different SDKs for various different things, and I'm afraid that in reality old versions of SDKs tend to stick around for years after support for them has been dropped, simply because products which use those SDKs may keep on going for years. When that happens, it means you're stuck with a cranky old SDK just because the alternative of using the latest version is far too much work.

On a related note, If this is just a DirectX problem and not related with getting a game engine to work, then the Microsoft Community boards might be a good place to ask for tutorials

This post has been edited by Bench: 02 October 2011 - 07:18 AM

Was This Post Helpful? 0
  • +
  • -

#9 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 07:21 AM

There have been quite a few changes in the DirectX APIs. Most of the older APIs are deprecated. So DirectInput is out of favor, and you use Windows input handling + XInput instead. Sound is XAudio. Etc.

The graphics API has also changed. Direct3D has significantly changed from D3D 9 to 10+. The FFP has been utterly dropped, so there's a massive divide between the two. Direct2D and DirectWrite have been introduced in recent SDK versions.
Was This Post Helpful? 0
  • +
  • -

#10 newn  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 119
  • Joined: 22-April 09

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 07:32 AM

So you're saying that I should ask at MSDN forums for help on how to set up a game engine? To tell the truth, I don't really think that somebody would want to help me with that, I would be pointed to learn small concepts of it and join everything together myself. My learning curve is a bit different that of most people though, I've trouble learning small parts as I have trouble with my memory. I learn by taking a framework (a game engine) and working with it, creating a project, that is how I learned about winapi. Now I want to learn DirectX to start a more serious project, something that would be unique, however that was the only engine tutorial I was able to find.

By the way, I'm not going into 3D, I'm going for 2D, for now.
Was This Post Helpful? 0
  • +
  • -

#11 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 07:39 AM

> By the way, I'm not going into 3D, I'm going for 2D, for now.

2D is 3D without using the third dimension. You'll be using ortho projections, but otherwise, you have similar concerns. It does simplify the math significantly, but you still have to learn to deal with some of the more fundamental concepts.

Also, still have to do 2D transforms, so you still have to be able to setup the rotation, translation, etc. matrices.
Was This Post Helpful? 0
  • +
  • -

#12 newn  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 119
  • Joined: 22-April 09

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 07:50 AM

Not only math but graphics design as well. My ultimate goal is a 2D scroller.

Been looking for tutorials again (and still am, in fact), although most of them goes for SDL... I really can't believe there aren't any tutorials available on this subject.
---
Currently I've read and and completely understood how to display moving sprites, how to use input and collision with DirectX.
I have completely no understanding about tilemaps and sounds at the moment, as the tile-system seems to have some problems too (the program runs fine after I remove the sound-related code, so I was able to test it).
Was This Post Helpful? 0
  • +
  • -

#13 #define  Icon User is offline

  • Duke of Err
  • member icon

Reputation: 1344
  • View blog
  • Posts: 4,608
  • Joined: 19-February 09

Re: Cannot open include file: 'dxstdafx.h': No such file or direct

Posted 02 October 2011 - 11:33 AM

It looks like dxstdafx.h is probably a precompiled header (Wiki).

You are right there doesn't appear to be much on DirectSound.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1