LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-02-2011, 11:33 AM   #1
A7MADOOV
LQ Newbie
 
Registered: Jan 2011
Posts: 6

Rep: Reputation: 3
Post 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
 
Old 01-02-2011, 11:42 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by A7MADOOV View Post
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.

Last edited by Nylex; 01-02-2011 at 11:46 AM.
 
Old 01-02-2011, 11:45 AM   #3
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,372

Rep: Reputation: 5389Reputation: 5389Reputation: 5389Reputation: 5389Reputation: 5389Reputation: 5389Reputation: 5389Reputation: 5389Reputation: 5389Reputation: 5389Reputation: 5389
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.

Last edited by dugan; 01-02-2011 at 11:51 AM.
 
2 members found this post helpful.
Old 01-02-2011, 01:00 PM   #4
A7MADOOV
LQ Newbie
 
Registered: Jan 2011
Posts: 6

Original Poster
Rep: Reputation: 3
cannot include file 'graphic.h' no such file or directory this is error
 
Old 01-04-2011, 11:56 AM   #5
ameyjah
LQ Newbie
 
Registered: Apr 2008
Posts: 13

Rep: Reputation: 0
Quote:
Originally Posted by A7MADOOV View Post
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile problem wmoti Programming 5 11-08-2005 07:23 AM
Problem to compile os2 Programming 4 05-03-2005 01:36 PM
C++ compile problem -- HELP !! aherrys Linux - Software 2 01-06-2005 03:29 AM
ntop compile/post-compile problem? tjb Linux - Software 3 12-28-2004 04:22 PM
Problem with compile noeffort Linux - Software 2 02-29-2004 01:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration