none
fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory

    Question

  •  

    Trying to compile a DXUT sample application that came with DX9(November 2007).

    I have Visual Studio 2005 Standard on Windows Vista32

    This question is common on the web; I've tried many of the suggestions to fix this error, without luck.

     

    In Tools->Options->VC++ Directories,  I've included :

    C:\Program Files\Microsoft DirectX SDK (November 2007)\Include

    C:\Program Files\Microsoft DirectX SDK (November 2007)\Lib

    $(DXSDK_DIR)include

    $(VCInstallDir)Include

     

    My environment variables that were set up during DX installation: 

    In System Variables there is: DXDK_DIR  C:\Program Files\Microsoft DirectX SDK (November 2007)\

     

    What else can I do?

     

     

    Tuesday, December 04, 2007 7:50 PM

Answers

  • I figured it out. 

    In Project->Properties->C/C++ General:  added C:\Program Files\Microsoft DirectX SDK (November 2007)\Include

     

    GeEEsh!  It seems to me that the original inclusion under Tools->Options->VC++ directories would be enough, but have to include it again on a per application basis.

     

    Tuesday, December 04, 2007 9:34 PM

All replies

  • I figured it out. 

    In Project->Properties->C/C++ General:  added C:\Program Files\Microsoft DirectX SDK (November 2007)\Include

     

    GeEEsh!  It seems to me that the original inclusion under Tools->Options->VC++ directories would be enough, but have to include it again on a per application basis.

     

    Tuesday, December 04, 2007 9:34 PM
  • Yeah Me too...
    C:\Program Files\Microsoft DirectX SDK (August 2008)\Include
    C:\Program Files\Microsoft DirectX SDK (August 2008)\Lib\x86
    OK~! Solved
    Saturday, September 20, 2008 9:52 AM
  • Yeah Me too...
    C:\Program Files\Microsoft DirectX SDK (August 2008)\Include
    C:\Program Files\Microsoft DirectX SDK (August 2008)\Lib\x86
    OK~! Solved

    firstly,I am depressed by this question:

    LINK : fatal error LNK1104: cannot open file 'd3dx9.h'

    I am a newbie for studying VC++ 2010,

    I do just like above method step by step,

    C:\Program Files\Microsoft DirectX SDK (June 2010)\Include

    C:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86

    (seprate by semi-colon ";")

    however I got a new question that Any program cannot run now:

    LINK : fatal error LNK1104: cannot open file 'd3d9.h'

    Any help will be appreciated,Thanks!

    Email:        wjhasd2006@163.com


    Friday, March 02, 2012 2:18 PM
  • >LINK : fatal error LNK1104: cannot open file 'd3d9.h'

    You have *not* configured the project correctly.

    That is a link-time error, and the *linker* should *not*
    be looking for a *header* file (*.h). Header files are
    used by the compiler (preprocessor), not the linker.
    The linker needs the *library* file(s): *.lib

    The compiler must know where to find the *.h files,
    the linker needs to know which *.lib files to use
    and where to find them.

    - Wayne
    Friday, March 02, 2012 5:17 PM
  • >I do just like above method step by step,
    >C:\Program Files\Microsoft DirectX SDK (June 2010)\Include
    >C:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86
    >(seprate by semi-colon ";")

    If you are separating those by a semicolon then you are
    setting things incorrectly. They do *not* both go in
    the same property settings, so should *not* appear
    together.

    There are two requirements: the header and the lib file.

    (1) The compiler needs to know where the header is located.

    (2) The linker needs to know where the .lib file is located,
    and the lib file name.

    These need to be specified in the Project Properties.

    For (1), go to:

    Configuration Properties->C/C++->General

    and set the path for the *header* (*.h) file in
    "Additional Include Directories"

    For (2), go to:

    Configuration Properties->Linker->General

    and set the path for the .lib file in
    "Additional Library Directories"

    Also go to:

    Configuration Properties->Linker->Input

    and set the .lib file name in
    "Additional Dependencies"

    - Wayne
    • Proposed as answer by 福云昭 Thursday, July 12, 2012 3:30 PM
    Friday, March 02, 2012 5:30 PM
  • I am please to Wayne's help for above method,

    I tried to fix it step by step,but the Error also the same,

    Monday, March 12, 2012 8:34 AM
  • Monday, March 12, 2012 8:35 AM
  • thanks Wayne for your help,

    I am a newbie to C/C++ for DirectX study,

    however I am depressed by the above question which  I've tried many of the suggestions to fix this error, without luck.

    I hope I can stick a bit longer, 

    Any help will be appreciated,Thanks!

    Monday, March 12, 2012 8:50 AM
  • >I do just like above method step by step,
    >C:\Program Files\Microsoft DirectX SDK (June 2010)\Include
    >C:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86
    >(seprate by semi-colon ";")

    If you are separating those by a semicolon then you are
    setting things incorrectly. They do *not* both go in
    the same property settings, so should *not* appear
    together.

    There are two requirements: the header and the lib file.

    (1) The compiler needs to know where the header is located.

    (2) The linker needs to know where the .lib file is located,
    and the lib file name.

    These need to be specified in the Project Properties.

    For (1), go to:

    Configuration Properties->C/C++->General

    and set the path for the *header* (*.h) file in
    "Additional Include Directories"

    For (2), go to:

    Configuration Properties->Linker->General

    and set the path for the .lib file in
    "Additional Library Directories"

    Also go to:

    Configuration Properties->Linker->Input

    and set the .lib file name in
    "Additional Dependencies"

    - Wayne

    Thank you very much,but I have not fixed that problem ,I just tried your method step by step,and I also check the directory ,the "d3dx9.h" is just in that,but why not linked?  what else I can do? Thanks!
    Monday, March 12, 2012 9:18 AM
  • Monday, March 12, 2012 9:20 AM
  • skype:wjhasd2006
    Monday, March 12, 2012 9:20 AM
  • >I also check the directory ,the "d3dx9.h" is just in that

    In *what*?

    >but why not linked?

    As I explained previously, *header* files do NOT get "linked".
    A file with an extension of .h is a header file. It's used by
    the preprocessor before *compilation* begins.

    What gets *linked* (by the linker) are object files (*.obj)
    and library files (*.lib).

    You apparently have not understood anything you've been told.

    The picture you posted with an added translation of
    "Additional Include Directories" shows a list in the
    dialog of LIBRARY *files* (*.lib), Why are you putting
    *filenames* in a setting that asks for DIRECTORIES?
    Further, why are the files LIBRARY files when that
    setting is related to HEADER files? There should be
    NO filenames in that setting, just directories. The
    directories listed in that setting must be where the
    *header* files (*.h) are to be found.

    The other picture you posted shows a dialog in which
    you have entered the directories for BOTH headers
    (\Include) AND libraries (\Lib). That's wrong. Each
    setting is for EITHER headers/includes OR libraries.
    None of the settings are for BOTH. One setting is
    for the *compiler* and the other is for the *linker*.

    You have been told which settings to use to tell the
    linker which *.lib file(s) to use, and where to find
    it/them.

    Read my detailed explanation again, and keep rereading
    it until you understand it.

    - Wayne

    Monday, March 12, 2012 10:17 PM
  • I'm sorry that did not fully understand what you mean!

    There are two requirements: the header and the lib file.

    (1) The compiler needs to know where the header is located.

    (2) The linker needs to know where the .lib file is located,
    and the lib file name.

    These need to be specified in the Project Properties.

    For (1), go to:

    Configuration Properties->C/C++->General

    and set the path for the *header* (*.h) file in
    "Additional Include Directories"
    added only:C:\Program Files\Microsoft DirectX SDK (June 2010)\Include

    For (2), go to:

    Configuration Properties->Linker->Input

    and set the .lib file name in
    "Additional Dependencies"
    added only:d3dx9.lib;d3d9.lib

    ( By the way,the others like following:                                    kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;d3dxof.lib;dxguid.lib;d3dx9d.lib;winmm.lib;%(AdditionalDependencies)                    is default after I completed installing     "Microsoft DirectX SDK (June 2010)",not manual added                   )    

    I also tried re-install the soft of Microsoft DirectX SDK (June 2010),but why ont fix the problem,either did I not understand what your mean exactly or maybe others issuses?  Thank you very much!


    • Edited by Kevin吴紫晋 Wednesday, March 14, 2012 8:24 AM spell error
    Wednesday, March 14, 2012 8:23 AM
  • Thank you very much!   I'm sorry that did not fully understand what you mean!

    I also tried re-install the soft of Microsoft DirectX SDK (June 2010),and then tried your method again;

    but why ont fix the problem,either did I not understand what your mean exactly or maybe others issuses?  Thank you very much!

    Wednesday, March 14, 2012 8:30 AM
  • In the screenshot above that you provided the translation "Additional Include Directories" is wrong. This is "Additional Dependencies" section of Linker, which lists default libraries added by setup of VC++ 2010. The list seems to be okay. The directory C:\Program Files\Microsoft DirectX SDK (June 2010)\Include with include file d3dx9.h you must add in Compiler-> Additional Include Directories, which is also added according to your screenshot.

    Now, if you would show us the screenshot with error message generated we could probably help you more (because, as Wayne mentioned, linker cares about .lib but not .h files).

    Wednesday, March 14, 2012 9:04 AM
  • In the screenshot above that you provided the translation "Additional Include Directories" is wrong. This is "Additional Dependencies" section of Linker, which lists default libraries added by setup of VC++ 2010. The list seems to be okay. The directory C:\Program Files\Microsoft DirectX SDK (June 2010)\Include with include file d3dx9.h you must add in Compiler-> Additional Include Directories, which is also added according to your screenshot.

    Now, if you would show us the screenshot with error message generated we could probably help you more (because, as Wayne mentioned, linker cares about .lib but not .h files).

    thank you very much for you help,The screenshot above that I provided the translation "Additional Include Directories" is wrong last time,the exact should be "Additional Dependencies" ;

    the popup prompt-note is generated by the right click in the wave accentuate!

    Pls help me ,thank you very much!  Best wishes for you and your family!

    Wednesday, March 14, 2012 1:32 PM
  • >the popup prompt-note is generated by the right click in the wave accentuate!

    When i asked to show us the error message i meant the screenshot with results of your build or compile attempt (i.e. error window output at the bottom). Without any "popup prompt-note" (whatever it is). By the way, we are mostly not from Chinese origin, thus, having difficulties reading in Mandarin without even option to use Google translate. 

    Wednesday, March 14, 2012 2:18 PM
  • >the popup prompt-note is generated by the right click in the wave accentuate!

    When i asked to show us the error message i meant the screenshot with results of your build or compile attempt (i.e. error window output at the bottom). Without any "popup prompt-note" (whatever it is). By the way, we are mostly not from Chinese origin, thus, having difficulties reading in Mandarin without even option to use Google translate. 

    Thank your again!
    Output window had already uploaded the srceenshot in the first time of  uploading picture! Like this:

    Traslate into English is the Subject of this texture:

    fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory

    Thursday, March 15, 2012 10:33 AM
  • Microsoft Visual Studio 2010 Ultimate

    Microsoft DirectX SDK (June 2010)

    Visual Studio Assist X 10.6.1850

    Thursday, March 15, 2012 10:50 AM
  • >fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory

    So, we found out that this is in fact a compiler (not linker) generated message C1083 (not linker's "fatal error LNK1104"). And the file d3dx9.h is really in include directory "C:\Program Files\Microsoft DirectX SDK (June 2010)\Include".  Which is added in "Additional Include Directories" (according to screenshot). All seems to be correct but the error is still generated. One more thing you can try - add this directory in main list: Project->Properties->Configuration Properties->VC++ Directories->Include Directories. And remove library's folder "C:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86" from "Additional Include Directories" (it does not belong there).           

    • Proposed as answer by Drainyard Wednesday, January 09, 2013 10:52 PM
    Thursday, March 15, 2012 11:21 AM
  • >fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory

    So, we found out that this is in fact a compiler (not linker) generated message C1083 (not linker's "fatal error LNK1104"). And the file d3dx9.h is really in include directory "C:\Program Files\Microsoft DirectX SDK (June 2010)\Include".  Which is added in "Additional Include Directories" (according to screenshot). All seems to be correct but the error is still generated. One more thing you can try - add this directory in main list: Project->Properties->Configuration Properties->VC++ Directories->Include Directories. And remove library's folder "C:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86" from "Additional Include Directories" (it does not belong there).           

    Thank you for giving me so much help and encouragement for these day!

    "Additional Include Directories" 

    only added just one directory manualy after Wayne prompted me to rectify it three days ago:

    C:\Program Files\Microsoft DirectX SDK (June 2010)\Include

    Thursday, March 15, 2012 11:34 AM
  • >fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory

    So, we found out that this is in fact a compiler (not linker) generated message C1083 (not linker's "fatal error LNK1104"). And the file d3dx9.h is really in include directory "C:\Program Files\Microsoft DirectX SDK (June 2010)\Include".  Which is added in "Additional Include Directories" (according to screenshot). All seems to be correct but the error is still generated. One more thing you can try - add this directory in main list: Project->Properties->Configuration Properties->VC++ Directories->Include Directories. And remove library's folder "C:\Program Files\Microsoft DirectX SDK (June 2010)\Lib\x86" from "Additional Include Directories" (it does not belong there).           

    Thank you for giving me so much help and encouragement for these day!

    "Additional Include Directories" 

    only added just one directory manualy after Wayne prompted me to rectify it three days ago:

    C:\Program Files\Microsoft DirectX SDK (June 2010)\Include

    I would like to know if you are willing to provide remote rectifying(repair) service? Thanks a lot !


    • Edited by Kevin吴紫晋 Thursday, March 15, 2012 11:42 AM spell error
    Thursday, March 15, 2012 11:40 AM
  • >I would like to know if you are willing to provide remote rectifying(repair) service? Thanks a lot !

    Here we usually help people having troubles with code parts they wrote in native C++ and C++/CLI. And sometimes we got rewarded by accepted answers or useful reply marks. For remote services you have to hire a programmer or to subscribe for technical support on a regular basis. That is how it works (or should work).  



    Thursday, March 15, 2012 1:02 PM
  • >I would like to know if you are willing to provide remote rectifying(repair) service? Thanks a lot !

    Here we usually help people having troubles with code parts they wrote in native C++ and C++/CLI. And sometimes we got rewarded by accepted answers or useful reply marks. For remote services you have to hire a programmer or to subscribe for technical support on a regular basis. That is how it works (or should work).  



    I would like to know if you are willing to send the soft :

    "Microsoft Visual Studio 2010 Ultimate(English Version)"

    (best accompanied by the installation wizard instructions )

    to me or tell me where I can download it,

    For it depressed me so much and so long,If it can not be resolved as long as the re-install the other new version!

    Thank you very much!

    E_mail:wjhasd2006@163.com


    Friday, March 16, 2012 12:55 AM
  • This method is best solution about the question.Please read carefully.

    Thank you ! 

    Wayne 

    Thursday, July 12, 2012 3:38 PM