Ask your own question, for FREE!
Computer Science 11 Online
OpenStudy (anonymous):

How do I make a program in standard C which uses graphics.h. What I mean is, how do I run a code that includes graphics.h in the header file. For some reason Visual Studio doesn't accept this and outputs some error. Can Someone please help?

OpenStudy (anonymous):

Which IDE are you using?

OpenStudy (anonymous):

I'm using Microsoft visual studio.

OpenStudy (andrew.m.higgs):

What does the error say?

OpenStudy (anonymous):

What specific version and what is the error your getting? It is my understanding that Microsoft Visual Studio does not have a 'graphics.h' file. With "#include "graphics.h" you include a header file of a library into your code, but the header file must be in the include paths associated with Visual Studio. You can set additional include paths in the project properties within Visual Studio by right clicking on project in the project explorer and going to Properties ->Additional Include directories. Even then, I'm not sure if it will successfully support the file. Only trial and error will tell.

OpenStudy (anonymous):

Okay, so say I was to run the code from this website: http://www.c.happycodings.com/Games_and_Graphics/code31.html It has the header file graphics.h, does that still mean it won't work in Visual Studios?

OpenStudy (anonymous):

I don't see the "graphics.h" file on that website. I can see the main source, but "graphics.h" is only included--the source itself is not provided. The only way I could tell you that would be to get a hold of the "graphics.h" source file and try it out.

OpenStudy (anonymous):

What i'm trying to say is that it's included in the code. If I had the graphics.h source file, how would I get it to still work in visual studios. Or would the graphics.h source file not be enough? Would It require some other files?

OpenStudy (anonymous):

Is there something else that is used in Visual studios that allows graphic programming?

OpenStudy (anonymous):

If you have the "graphics.h" file, you would do as I suggested in one of the answers above. I've quoted it for you again here: ""#include "graphics.h" you include a header file of a library into your code, but the header file must be in the include paths associated with Visual Studio. You can set additional include paths in the project properties within Visual Studio by right clicking on project in the project explorer and going to Properties ->Additional Include directories." However, this does not ensure that it will work. You simply need to try it and see.

OpenStudy (anonymous):

Thanks!

OpenStudy (anonymous):

Anytime!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!