LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 12:33 PM   #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, 12:42 PM   #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 12:46 PM.
 
Old 01-02-2011, 12:45 PM   #3
dugan
Senior Member
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 4,987

Rep: Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555Reputation: 1555
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 12:51 PM.
 
2 members found this post helpful.
Old 01-02-2011, 02: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, 12:56 PM   #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 08:23 AM
Problem to compile os2 Programming 4 05-03-2005 02:36 PM
C++ compile problem -- HELP !! aherrys Linux - Software 2 01-06-2005 04:29 AM
ntop compile/post-compile problem? tjb Linux - Software 3 12-28-2004 05:22 PM
Problem with compile noeffort Linux - Software 2 02-29-2004 02:02 PM


All times are GMT -5. The time now is 09:56 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration