Change include paths + Visual Studio
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: Change include paths + Visual Studio

  1. #1
    Join Date
    Nov 2003
    Posts
    2,185

    Change include paths + Visual Studio

    Hi all,

    I am creating a sound engine in visual studio (.net 2003). Well, I have to include <dsound.h>. I have installed the directx sdk, but when I include <dsound.h>, it includes a film from visual studio\prerelease\.

    Can I set the include directory of the directx header files???

    Thanks!

  2. #2
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    73

    Wink Re: Change include paths + Visual Studio

    Hi,

    you can either set local include paths for your current project and/or global for alle projects. There you simply need to add your DirectX include folder and move it prior to the SDK list entry. Thats all.

    Here's the position where you can find the options (I needed to translate from german, so your menu entries may have different names):
    (Menu) Extras -> Options -> (Dialog) Projects -> VC++ Directories : Set Directory Type to Include Directories and add your directory

    Project only:
    (Popup Menu) Project Properties -> (Dialog) Configuration -> C/C++ -> Common : Additional Include Directories

    Good luck!
    Michael Maier
    xplo.re
    Project Management

    http://xplo-re.com/ [^]
    Giving reputation lets one know if a reply has been helpful. Thanks.

  3. #3
    Join Date
    Nov 2003
    Posts
    2,185

    Re: Change include paths + Visual Studio

    well, it already is in the main settings. It is the directory at the top (so I guess directx inserted it there already)

    I also tried to add the project specific option (adding extra include path), but both options didn't work!

    Note: I first started the project, and then I installed DirectX SDK. That should be no problem, right?

  4. #4
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    73

    Re: Change include paths + Visual Studio

    Yes, usually does DirectX SDK does this for you... And installing the SDK after creating the project isn't a problem (or, shouldn't).
    Did you check the DirectX include directory for dsound.h? Maybe the file got corrupted or lost, however this may have happened.
    Michael Maier
    xplo.re
    Project Management

    http://xplo-re.com/ [^]
    Giving reputation lets one know if a reply has been helpful. Thanks.

  5. #5
    Join Date
    Nov 2003
    Posts
    2,185

    Re: Change include paths + Visual Studio

    well, strange. The white edit control above my document says the location of the <dsound.h> is microsoft visual studio .net\vc7\platformsdk\include\prerelease\dsound.h

    But when I compile, there are a lot of errors in the dsound.h. The filename is then:
    e:\directx\Include\dsound.h

    very weird, but it get's the right file now (at least, i guess)

    But why are all the compiling errors??

    DirectX\Include\dsound.h(230): error C2501: 'LPCWAVEFORMATEX' : missing storage-class or type specifiers
    DirectX\Include\dsound.h(349): error C2146: syntax error : missing ';' before identifier 'lpwfxFormat'


    Thanks for the help so far!

  6. #6
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    73

    Re: Change include paths + Visual Studio

    This is quite common, MSDEV somehow first searches it's "well known" include directories when using the "Open xy.h" command, somehow ignoring the include directory list.
    About the compile errors, LPCWAVEFORMATEX is a type defination of dsound.h for a const WAVEFORMATEX* structure pointer; it usually should be avaible. Also it should have been defined there...
    Quite at the beginning of the dsound.h file should stand the following lines:
    Code:
    //
    // Compatibility typedefs
    //
    
    #ifndef _LPCWAVEFORMATEX_DEFINED
    #define _LPCWAVEFORMATEX_DEFINED
    typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
    #endif // _LPCWAVEFORMATEX_DEFINED
    Maybe a defination miss-match in your project?
    Michael Maier
    xplo.re
    Project Management

    http://xplo-re.com/ [^]
    Giving reputation lets one know if a reply has been helpful. Thanks.

  7. #7
    Join Date
    Nov 2003
    Posts
    2,185

    Re: Change include paths + Visual Studio

    no, all errors occure in the dsound.h

    I also linked dsound.lib to my project!

    and the list with errors is long, very long!

  8. #8
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    73

    Re: Change include paths + Visual Studio

    Hmm, thats strange. Can you post your dsound.h so I can have a look at it?
    Also, did you change some compiler settings?
    Michael Maier
    xplo.re
    Project Management

    http://xplo-re.com/ [^]
    Giving reputation lets one know if a reply has been helpful. Thanks.

  9. #9
    Join Date
    Nov 2003
    Posts
    2,185

    Re: Change include paths + Visual Studio

    sorry to spend your time!

    I was using
    DirectSound8 m_pdsObject;
    and it should be
    LPDIRECTSOUND8 m_pdsObject;

    Thanks for all the help!

  10. #10
    Join Date
    Aug 2004
    Location
    Germany
    Posts
    73

    Re: Change include paths + Visual Studio

    Ah, IC, that's okay then ^^ Np! Good luck with your project!
    Michael Maier
    xplo.re
    Project Management

    http://xplo-re.com/ [^]
    Giving reputation lets one know if a reply has been helpful. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center