LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 10-05-2005, 02:46 PM   #1
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Rep: Reputation: 30
Question header file problems in g++


hi

i tried my hand on a graphics program in c++.But when i compile the program, it says header files like graphics.h, conio.h etc not found.

How do i solve this problem?Is graphics used only for Turbo c++ compiler.
What all shud i know b'fore starting off with c++ programming in Linux??

I have Ubuntu (Hoary)....

g++ 3.3
libstdc++5
libstdc++5-3.3 - dgb and dev
gcc 3.3
libgcc


Please Help!!
 
Old 10-05-2005, 03:22 PM   #2
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
conio.h is a DOS specific header, and graphics.h is a TC++ specific header. Graphics programming itself is not limited to TC++, though. TC++ itself is an antiquated compiler that pre-dates the latest ANSI standards, and only produces DOS binaries. I'm always surprised when I find people are still using it, actually. There are so many better compilers available for free in both the Linux and Windows worlds.

A lot of graphics programming today is done in the context of a GUI system, such as Windows and X in the Linux world. You'll probably want to take a look at some windowing API. A good one to start with might be SDL, as I believe that has 2d graphics routines similar to what you would find in the old DOS graphics of TC++. I believe SDL also has a mode that allows for graphics outside of a GUI environment, though I've never actually messed with that aspect of it much. SDL is also cross-platform, meaning there are libraries for it in Windows, Linux, etc.
 
Old 10-05-2005, 07:39 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
deiussum is absolutely correct on all counts:

1. "conio.h" and "graphics.h" are old Turbo C/DOS headers you aren't likely to see on any current platform: Linux or Windows.

2. SDL might be a good Linux alternative to the old BGI graphics libraries.

3. You might also wish to explore Qt or GTK+ as "standard", cross-platform (Windows *and* Linux) libraries for graphics (and GUIs). My preference is GTK+ (and I use the raw GTK+ API from my C++ programs, much as you used to call the C-language BGI library functions from your Turbo C++ programs).

'Hope that helps .. PSM
 
Old 10-06-2005, 01:13 PM   #4
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Original Poster
Rep: Reputation: 30
Lightbulb thanx for clarifying some doubts!!

thanx guys

for clarifying some of my doubts...
But what if I wish to draw just a plane circle,line or polygon and other shapes.Well all this is crap nowadays but my Graphics Course needs it.

Can i draw these thru GTK+ or SDL?
Well i don't know GTK+ or SDL programming.Are there any good sources from where i can learn these??

Please Help!!
 
Old 10-06-2005, 01:24 PM   #5
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Yes, SDL and GTK+ (and many, many others) are *precisely* for drawing plain circles, lines, polygons, etc.

SDL is oriented more toward games: I haven't tried it; I'm not directly familiar with it. You can learn more here:

http://www.libsdl.org/

GTK+ is oriented more toward GUIs. It started out as the base library for "The Gimp" (an extremely popular Open Source graphics program), but it's become much more than that. I have nothing but high praise for GTK+. It's advantages include:

1. It's very easy to write a "hello world" (and only slightly more difficult
to write a "hello world" to a drawing area that lets you draw circles and polygons...)

2. It's cross-platform

3. It supports the gamut of things you'd want to do: user interface, raster imaging, vector drawing, good integration with the underlying windowing subsystem, etc etc:

http://www.gtk.org/

'Hope that helps .. PSM
 
Old 10-07-2005, 01:28 AM   #6
crash_override_me
Member
 
Registered: Aug 2005
Location: India, New Delhi
Distribution: Debian Etch, Ubuntu
Posts: 342

Original Poster
Rep: Reputation: 30
Thumbs up thanx Paul

thanx dude

U have been great help.....
In which languages can i do GTK+ programming??

Does is it significantly change the way i program??
 
  


Reply



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
Problem with c header file alaios Programming 4 09-03-2005 09:06 PM
Create header file for existing .c file hk_michael Programming 5 02-25-2005 05:26 PM
header file location ..mach.h .. pashupathinath Programming 1 10-21-2004 06:27 PM
hdr(header file) question? bbmak Linux - Newbie 1 09-10-2004 01:45 AM
Compiling a header file with gcc Squall Linux - Software 2 04-07-2004 05:16 AM

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

All times are GMT -5. The time now is 10:41 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
Open Source Consulting | Domain Registration