Thread: DirectX hates me

  1. #1
    Registered User
    Join Date
    Apr 2010
    Posts
    43

    DirectX hates me

    Ok, the question does not concern too much of DirectX experience. But I will post it in the Windows section, because I am creating a Windows Application here after all.

    I am including d3d9.h, d3dx9.h and windows.h. When I compile the program, it says this:
    Code:
    h:\work\microsoft directx sdk (february 2010)\include\d3dx9math.h(26) : error C2653: 'D3DXFLOAT16' : is not a class or namespace name
    .

    H:\Work is the directory where I installed DirectX SDK. No matter how many examples from book I tried, same error. There are lots anyway, but I think that if I solve that, all the rest of them will be solved as well... I could post the header file is someone needs it or something. But please help me, I can't get rich in this way.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    This is somewhat interesting, as at least according to MSDN, D3DXFLOAT16 is defined in d3dx9math.h which is the very header file you're looking at. I suppose you could look at the header file and see what's going on. Is your project C++? Are you doing something interesting with your #define's?

  3. #3
    Registered User
    Join Date
    Apr 2010
    Posts
    43
    Quote Originally Posted by tabstop View Post
    This is somewhat interesting, as at least according to MSDN, D3DXFLOAT16 is defined in d3dx9math.h which is the very header file you're looking at. I suppose you could look at the header file and see what's going on. Is your project C++? Are you doing something interesting with your #define's?
    Nothing at all. Very freaky indeed. My computers acts so strange, even computer geeks freak out... like when all of a sudden Minesweeper won't laungh or when Oblivion needs only 200 RAM, while other smaller games overrun it...

    Here's the math header, if you have time. Thank you very much for answering so fast. d3dx9math.h ... at uploaded.to - Free File Hosting, Free Image Hosting, Free Music Hosting, Free Video Hosting, ...

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    This is quite strange. If you are including d3dx9.h you will be picking up d3dx9math.h. Need more information b/c according to what you have posted you should not be getting this error. I am assuming something else is going on like you are not pointing your IDE to your DirectX SDK include folder or something along those lines.

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    I just downloaded the latest release of the DirectX SDK and had a look at my d3dx9math.h and it differs quite alot from yours. I suggest you completely uninstall the directx SDK, remove the install directory from Program Files (called something like Microsoft DirectX SDK 2010), download the latest release and try to reinstall.

  6. #6
    Registered User
    Join Date
    Apr 2010
    Posts
    43
    Quote Originally Posted by Shakti View Post
    I just downloaded the latest release of the DirectX SDK and had a look at my d3dx9math.h and it differs quite alot from yours. I suggest you completely uninstall the directx SDK, remove the install directory from Program Files (called something like Microsoft DirectX SDK 2010), download the latest release and try to reinstall.
    Damn it. So you are suggesting me I should try to install SDK 2009 maybe, or something? Thanks for your responses. If someone knows another one as well, please post here. I will still like this thread to be open for like mroe 24 hours.

    I installed the latest version though. Could you please point me to the link you have downlaoded it from or at least upload the header?

  7. #7
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    Nah your installation probably got corrupt or something. I suggest you uninstall the sdk completely, including deleting the install dir (something the uninstaller probably wont do for you). I got the sdk from Download details: DirectX SDK - (February 2010)

    So might want to try there. Since you seem to have a corrupt installation i would do a complete reinstall because you might also miss something else important.

  8. #8
    Registered User
    Join Date
    Apr 2010
    Posts
    43
    Quote Originally Posted by Shakti View Post
    Nah your installation probably got corrupt or something. I suggest you uninstall the sdk completely, including deleting the install dir (something the uninstaller probably wont do for you). I got the sdk from Download details: DirectX SDK - (February 2010)

    So might want to try there. Since you seem to have a corrupt installation i would do a complete reinstall because you might also miss something else important.
    I did it. I actually used DirectX 9 SDK this time... If I compile it with VS 2010 I get the same ........... With Visual C++ 6.0 (which easily adds the DirectX includes to the directories), it does not give me that any more... but still, I got another crazy stupid errors right from their own samples folder!! It drives me nuts... I am sick of all those stupid programmers out there, making windows crap without testing it.. Damn it. I don't know what to do.

    I do thank you for your effort, but this has to be my noob mind as well. I can't smash my hands anymore.

    Edit: Most of the programs from bin work. And they are really great. My only 4 errors now are:
    Code:
    H:\Work\Microsoft DirectX SDK\Samples\C++\Common\src\d3dsettings.cpp(276) : error C2664: 'DialogBoxParamA' : cannot convert parameter 4 from 'long (struct HWND__ *,unsigned int,unsigned int,long)' to 'int (__stdcall *)(struct HWND__ *,unsigned int,u
    nsigned int,long)'
            None of the functions with this name in scope match the target type
    H:\Work\Microsoft DirectX SDK\Samples\C++\Common\src\d3dsettings.cpp(498) : error C2065: 'ULongToPtr' : undeclared identifier
    H:\Work\Microsoft DirectX SDK\Samples\C++\Common\src\d3dsettings.cpp(671) : error C2065: 'UlongToPtr' : undeclared identifier
    But at least I don't get that thing anymore. I never thought of reinstalling. Thank you very much. It seems that DirectX 10 does not work with XP at all.
    Last edited by Veneficvs; 05-27-2010 at 02:31 PM.

  9. #9
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    It appears to me you are running into an ancient problem with a Microsoft specific data types file. We used to have a sticky on here about it but have since removed it. If you are using the newest SDK and you are using MSVS 2003+ you should not have any issues. If you are using MSVS 6 you will be missing tons of data types.

    I think you have the includes for an older SDK in your include path prior to the includes for the new SDK. Remove all DirectX SDK paths from your project include paths and then add just one that points to the new SDK include path.

    I assure you that the DirectX SDK has been thoroughly tested prior to release since thousands of game companies use it everyday.
    Last edited by VirtualAce; 06-02-2010 at 08:04 PM.

  10. #10
    Registered User
    Join Date
    Jun 2010
    Posts
    1
    Quote Originally Posted by Bubba View Post
    It appears to me you are running into an ancient problem with a Microsoft specific data types file. We used to have a sticky on here about it but have since removed it. If you are using the newest SDK and you are using MSVS 2003+ you should not have any issues. If you are using MSVS 6 you will be missing tons of data types.

    I think you have the includes for an older SDK in your include path prior to the includes for the new SDK. Remove all DirectX SDK paths from your project include paths and then add just one that points to the new SDK include path.

    I assure you that the DirectX SDK has been thourougly tested prior to release since thousands of game companies use it everyday.
    I also think so.

    __________________
    Watch Splice Online Free

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems with my DirectX program
    By fighter92 in forum Game Programming
    Replies: 1
    Last Post: 01-23-2007, 06:28 PM
  2. Isometric Tile Engine using DirectX
    By Wraithan in forum Game Programming
    Replies: 3
    Last Post: 07-17-2006, 12:16 PM
  3. DirectSound header issues
    By dxfoo in forum C++ Programming
    Replies: 0
    Last Post: 03-19-2006, 07:16 PM
  4. DirectX - Starting Guide?
    By Zeusbwr in forum Game Programming
    Replies: 13
    Last Post: 11-25-2004, 12:49 AM
  5. Directx SDK Documentation
    By Zoalord in forum Game Programming
    Replies: 4
    Last Post: 05-08-2003, 06:07 AM