d3dx9.h: no such file or directories [duplicate] - c++

Edit: Of course, immediately after working on it for an hour then posting here, I found the stupid mistake...
I'm getting compiler errors when trying to #include <d3dx9.h> in a project. I'm receiving "fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory".
I do have the DirectX SDK installed (I also just tried reinstalling it to no avail).
In the Project Properties:
VC++ Directories are set to "$(DXSDK_DIR)Include;$(IncludePath)" and "$(DXSDK_DIR)Lib\x86;$(LibraryPath)" for Include and Library directories respectively for all configurations—and the environment variable %DXSDK_DIR% points to C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\ as expected.
C/C++ > General settings has $(DXSDK_DIR)include listed in the Additional Include Directories
Linker > Input > Additional Dependencies has d3dx9d.lib included for Debug and d3dx9.lib included for Release configuration.
I am able to successfully compile and run tutorial projects from the DirectX Sample Browser.
Visual Studio's Intellisense/autocomplete will find d3dx9.h and suggest type and function names that are within the file (and not included through anything else I'm #includeing) so it seems that Intellisense can find it.
Any suggestions on what I'm forgetting or what else to try?
Thanks

you forgot one thing:
Go to VC++ Directories -> Library Directories
add $(DXSDK_DIR)LIB\x86
apply.
Done. Hope this helps

You should make sure you have ALL paths sorounded by quotes (").
Instead of $(DXSDK_DIR)include you should have "$(DXSDK_DIR)include"

I didn't realize that one of the other projects in the solution was #includeing a file that was #includeing a file that was #includeing d3dx9.h and I hadn't added those paths to that project.
/facepalm

Find the file on your computer, and add it's folder to the properties of your project.
Assuming you have visual studio: Properties/C/C++/General/Additional Include Libraries.

I tried all of these suggestions and none worked.
Turns out the $(DXSDK_DIR) variable doesn't work if you install DirectX while Visual Studio is still running. The solution for me was to restart Visual Studio (+ adding the paths in the solutions listed above, of course).

Related

Cannot open include file "windows.h" No such file or directory

I am trying to build a project which contain several C# projects and one C++ project in VS 2013.
But during build the above error is shown, then i googled the error and tried several things but unable to fix the issue.
Things i have tried:
1) Added Window 10 SDK's Include directory to the Additional Include Directories
in C/C++ Configuration properties.
2) Added Window 10 SDK's Lib directory to the Additional Library Directories into the Linker.
3) Making sure that include file is "windows.h" instead of "Windows.h".
Path of Windows.h file present locally in SDK directory is
C:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\um
Does any have any idea how can i fix this ?
Any help will be appreciable.
Go to the project properties -> Configuration Properties -> General
then Change Platform Toolset to Visual Studio 2013- Windows XP(v120_xp).
This is what worked for me.

visual studio not seeing my include files

This may be a very simple question but I haven't been able to figure it out so any help is appreciated.
I have a header that is located in a general folder because I want to use it in several projects for example:
C:\user\geninclude\program\header.h
I created a new empty project with a very simple main, in the main I put
#include <program/header.h>
I then went to the project properties and in VC++ in include directories added C:\user\geninclude\
but when I tried to build the program the program tells me it cannot find header.h because is not in the current directory or in the build system path.
I also tried in the project properties in C/C++ general Additional Include Directories adding C:\user\geninclude\ but still the same error.
I know is something simple I am missing, but I don't know what, I am very new to this just learning.
For reference I am using Visual Studio 2013.
Thank you in advance for your help.
UPDATE: Thank you all for your kind responses, I have tried everything you have told me (check release vs debug in both instances, change / for \ and <> for "", and double checking the header and still the system does not see it. It really is very weird. I'll keep trying...
Please check if your file is really an header file otherwise it won't appear on include.
What you can also do (as a workaround if you need that method fast) is to put your header file (or folder with header files) on the visual studio "include" folder. The path should look like this "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include"
PS: You should also check the properties configuration when you're adding the path to VC++ include directories. You could be adding the path to debug configuration and trying to run it in release mode.
You do indeed want
Project Properties -> Configuration Properties -> C/C++ -> Additional Include Directories
(or something close to that; I'm using VS 2008). Make sure the configuration you're editing in the top left (debug/release) matches the configuration you're building with (typically visible up top in the main window). So it sounds like you may have done it correctly; I'd double-check for the file's existence in that location. You could also try program\header.h instead of program/header.h. If none of those work, try adding C:\user\geninclude\program to the include directories (no \ at the end) and change it to #include "header.h". If that doesn't work either, you've almost surely got the header file in the wrong spot.
Another thing that can cause include files not being picked up is a difference between the platform set in your c++ project's Property Pages and your "Active Solution Platform" in configuration manager. Can just check if one is set to x64 and the other x86
check if you have specified the path correctly. for example I had written cpp instead of c++ and therefore suffered a lot and wasted like an hour searching here and there.
For Visual Studio 2019 users:
Project(P) > yours_project_name properties(P) > Platform Toolset Visual Studio 2019(V###)
Reasoning: You might download the project from Online and they used other version of Visual Studio as Platform.
Project(P) > yours_project_name properties(P) > Windows SDK Version ##.#(latest installed version).
Reasoning: You might download the project from Online and they used version SDK 8.0 while you have SDK 10.0
ntucvhw

Visual studio c++ problems including poco

I am new to c++ and visual studio and am struggling with getting an include statement to work. I want to test out poco for online applications with c++ and found a basic example online that used
#include <Poco/String.h>
However, my Win32 project in visual studio throws an error stating "could not open include file". I added the path to project properties < VC++ Directories < Include Directories. I also added the path to linker < input < additional dependencies. I can't seem to get rid of that red underline and error though. When I am typing my include statement a list pops up but the directory listed is the "...Windows Kits\8.1\um\". Could anybody lend me a hand? I really appreciate any help. Thank you. Let me know if I can provide more info.
It should be added to 'C/C++ > Additional Include directories'
and it should be added as:
c:/some_folders_down
not
c:/some_folders_down/Poco
You say, 'Adding the directory'. You don't want to add the Poco folder to your path because when you #include <Poco/String.h> you are adding that part of the path there. Try:
#include <String.h>, if that works, fix your additional include path. Would you paste that path?
So apparently the default for visual studio is to add the the "additional directories" paths to Debug x64 since I am on a 64 bit OS. However, I forgot to switch to x64 in the solution platform drop down at the top of the VS window. If you right click on the .vcxproj and search for "AdditionalIncludeDirectories" you can view this directly. I feel like a facepalm is in order haha. Thanks so much to everyone who viewed my question.

Cannot open include file: 'd3dx9.h': No such file or directory [duplicate]

Edit: Of course, immediately after working on it for an hour then posting here, I found the stupid mistake...
I'm getting compiler errors when trying to #include <d3dx9.h> in a project. I'm receiving "fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory".
I do have the DirectX SDK installed (I also just tried reinstalling it to no avail).
In the Project Properties:
VC++ Directories are set to "$(DXSDK_DIR)Include;$(IncludePath)" and "$(DXSDK_DIR)Lib\x86;$(LibraryPath)" for Include and Library directories respectively for all configurations—and the environment variable %DXSDK_DIR% points to C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\ as expected.
C/C++ > General settings has $(DXSDK_DIR)include listed in the Additional Include Directories
Linker > Input > Additional Dependencies has d3dx9d.lib included for Debug and d3dx9.lib included for Release configuration.
I am able to successfully compile and run tutorial projects from the DirectX Sample Browser.
Visual Studio's Intellisense/autocomplete will find d3dx9.h and suggest type and function names that are within the file (and not included through anything else I'm #includeing) so it seems that Intellisense can find it.
Any suggestions on what I'm forgetting or what else to try?
Thanks
you forgot one thing:
Go to VC++ Directories -> Library Directories
add $(DXSDK_DIR)LIB\x86
apply.
Done. Hope this helps
You should make sure you have ALL paths sorounded by quotes (").
Instead of $(DXSDK_DIR)include you should have "$(DXSDK_DIR)include"
I didn't realize that one of the other projects in the solution was #includeing a file that was #includeing a file that was #includeing d3dx9.h and I hadn't added those paths to that project.
/facepalm
Find the file on your computer, and add it's folder to the properties of your project.
Assuming you have visual studio: Properties/C/C++/General/Additional Include Libraries.
I tried all of these suggestions and none worked.
Turns out the $(DXSDK_DIR) variable doesn't work if you install DirectX while Visual Studio is still running. The solution for me was to restart Visual Studio (+ adding the paths in the solutions listed above, of course).

fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory

I think I did all the necessary configuration but I am still getting this:
Error 1 fatal error C1083: Cannot open include file: 'boost/config.hpp': No such file or directory File:c:\documents and settings\administrator\my documents\visual studio 2008\libs\boost_1_43_0\boost\smart_ptr\shared_ptr.hpp Line:17
Here are screenshots of setting I have done to add directories for include and lib files :
Am I missing something ?
I finally found the answer :) and I will write it here to help.
Project>"YOURPROJECT" Properties>C/C++>General>Additional Include Directories then select where you downloaded your library . This worked and all the above didn't, so make sure not to forget it .
I installed boost from the installer. It installs the library in c:\program files\boost.
Add the directory to your project's properties like the below
Please note that you need to add the path of "boost" directory in both 64bit and 32bit configurations. While adding the path, make sure to select appropriate platform (64bit or 32bit) depending upon your need. If you compile in both versions, you need add both.
Boost library directory is valid for both the above configurations.
For me, I was building targeting the win32 platform. Changing to x64 worked.
I had a similar problem... I'm using Visual Studio 2019 16.6.3. I think it got stuck somehow. I had upgraded a solution with multiple projects from 2015 to 2019. Most of the projects were building but for some reason one static library (outputting a .lib) kept complaining about some header files.
After several hours, I finally got Visual Studio C++ "unstuck" by disabling:
"Project Properties->C/C++->Additional Include Directories->dropdown->Edit ...->Checkbox Inherit from parent or project defaults"
This seems to have triggered some kind of rebuild of a cache of valid header files or something. Now the compiler error has disappeared. I went back into the same dialog and re-enabled "Inherit from parent or project defaults" and things are fine.
mmake sure you are not looking at boost-system instead of boost-filesystem
If you're trying to install Turbodbc in a python environment and seeing errors similar to the one mentioned in this question, I have written a detailed answer for this in a different thread - https://stackoverflow.com/a/65850615/5333178
Add the namespace after all headers:
using namespace std;
removing from the header (.h) did the trick.
remove all the ".h" from all headers. Should work.