LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   C++ compile problem (https://www.linuxquestions.org/questions/programming-9/c-compile-problem-854126/)

A7MADOOV 01-02-2011 11:33 AM

C++ compile problem
 
hi i want to run this code
#include<iostream>
#include<conio.h>
#include<graphics.h>
i have error in graphics.h i have C++ 2005

Nylex 01-02-2011 11:42 AM

Quote:

Originally Posted by A7MADOOV (Post 4210512)
hi i want to run this code
#include<iostream>
#include<conio.h>
#include<graphics.h>
i have error in graphics.h i have C++ 2005

Again, you need to start new threads for your questions. I've reported this post to be split into a new thread.

It would help if you told us exactly what the error message was. Also, I don't know what you mean when you say you want to run that code, as there's no main() function in it..

Can you post the full code (if it's short, or the part where the errors occur, if not) along with those error messages?

Also, be aware the conio.h and graphics.h are Windows headers (I believe), so if you're trying to compile this on Linux, you won't be able to. Edit: see dugan's reply below.

dugan 01-02-2011 11:45 AM

Quote:

hi i want to run this code
#include<iostream>
#include<conio.h>
#include<graphics.h>
i have error in graphics.h i have C++ 2005
A7MADOOV, I've reported your post to be split into its own thread. Mods: I expect this reply to be split along with it.

My reply is: it doesn't work because you're trying to include proprietary Borland C++ headers in a project that you're building with Microsoft Visual Studio 2005. There is no reason at all to believe that Microsoft's compiler would support the proprietary extensions included with a competing compiler from the mid 90s.

Furthermore, conio.h and graphics.h are specifically meant for writing DOS programs. A program using them would not run in any other operating system.

If you got that code out of a C++ book, then throw that book out NOW. The book was obviously written for Borland C++. Borland C++ was released before C++ was standardized in 1998, so the book would not only be teaching you proprietary Borland C++ extensions, but also pre-standard C++.

And BTW, as you can see from reading the opening post in the "C/C++ tutorials" sticky thread, the sticky thread is for external links to C/C++ tutorials. Not for asking for C/C++ help.

A7MADOOV 01-02-2011 01:00 PM

cannot include file 'graphic.h' no such file or directory this is error

ameyjah 01-04-2011 11:56 AM

Quote:

Originally Posted by A7MADOOV (Post 4210566)
cannot include file 'graphic.h' no such file or directory this is error

As already said, these header files are not meant for MS VC++. Plus if want to solve your problem, paste what you are trying to achieve. I mean why do you need these header files at first place?


All times are GMT -5. The time now is 06:44 AM.