C++ problem

Carlos's Avatar, Join Date: Dec 2008
Contributor
hello! Can anyone tell me how can i include graphics.h in Visual C++ language.
b/c in Turbo C, i use #include "graphics.h" to include graphics in my project.
but Visual C++ compiler give this error.
Error 1 fatal error C1083: Cannot open include file: 'graphics.h': No such file or directory
reply me plz!
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Graphics package of Turbo C is only for BGI graphics and is not a part of Visual C++ compiler and so you would not be able to use BGI graphics in VC++
Carlos's Avatar, Join Date: Dec 2008
Contributor
So, how can i include graphics in Visual C++???
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
It has its own GD library.
Carlos's Avatar, Join Date: Dec 2008
Contributor
So how to include that GD library in our program??
Plz tell me the method
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Which VC++ version you are using.
Carlos's Avatar, Join Date: Dec 2008
Contributor
I have installed Visual C++ 2005 Express Edition
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
I am not sure of Express edition if its in built or you may need to download the package and install it.
skp819's Avatar
Contributor
It is simple, in your code you have the line

#include "graphics.h" or #include <graphics.h>

But the file graphics.h can not be found by the compiler.

If you have graphics.h on your computer then you must make sure that the path where it resides is in the include search path.

This is done through tools->options->projects and solutions->vc++ directories and switch show directories for to include files. Add the path to graphics.h there and then recompile. You must also make sure that any library files are also put into the lib path, this is done by switching show directories for to library files and then putting the path to the library files in there.
xpi0t0s's Avatar, Join Date: Aug 2004
Mentor
It's not that eay, skp819, the header file probably defines functions that can be found in a graphics library, so you also need to get the library.