LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-20-2006, 01:59 PM   #1
Alfred James Monroe
LQ Newbie
 
Registered: Jun 2006
Posts: 7

Rep: Reputation: 0
Angry gcc programming manual


In transferring C progams written in Borland C++ to Linux v6.0 I find that getch(), curon(), and curoff() functions are not recognized by gcc. Do these functions actually exist in gcc? If so, what is the header file name? If not, any suggestions on how to add them to gcc?

I have tried inline assembly which didn't work for the following reason....I get an error msg when the command 'int x010' executes. I have tried changing the argument to $10,$32,$16. The error msg when one stepping through the program in gdb is always:
'program received signal SIGSEGV, segmentation fault'
and the program terminates. Any suggestions?

Last edited by Alfred James Monroe; 06-21-2006 at 05:43 PM.
 
Old 06-20-2006, 02:20 PM   #2
jeelliso
Member
 
Registered: Oct 2005
Location: Knoxville, Tn (USA)
Distribution: OpenSUSE, Ubuntu
Posts: 250

Rep: Reputation: 30
getch is in curses.h (try "man getch")

I can't seem to find much reference to the curon and curoff functions. Tell me what these functions do. Maybe even provide some documentation on them if you have it.

~Justin
 
Old 06-21-2006, 10:28 AM   #3
Alfred James Monroe
LQ Newbie
 
Registered: Jun 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for your reply, Justin. Here is the info you requested.
curoff() turns the cursor off
curon() turns the cursor on
getch() gets a character from the keyboard without echo and returns immediately without waiting for a \r. It differs from getchar() in these two respects; no echo, no wait for \r
Use of these functions in Borland C++ requires conio.h which does not exist in gcc. Use of these functions is described in the manual provide in the C starter kit from Sams Publishing 'Teach Yourself C in 21 Days', authors Aiken & Jones.
I tried man getch; got no such entry msg. I'm using RedHat LINUX v6.0. I do not find curses.h in the /usr/include/ directory.
 
Old 06-21-2006, 12:30 PM   #4
jeelliso
Member
 
Registered: Oct 2005
Location: Knoxville, Tn (USA)
Distribution: OpenSUSE, Ubuntu
Posts: 250

Rep: Reputation: 30
curses.h is included in the ncurses library. I'm not sure about the other two functions, but you might look at curs_set.

Here is a good look at curses.h.

Good Luck,
~Justin
 
Old 06-21-2006, 12:59 PM   #5
Alfred James Monroe
LQ Newbie
 
Registered: Jun 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks Justin,
I will try ncurses and let you know if I have success!
 
Old 06-21-2006, 01:03 PM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
For info, functions are provided by libraries (e.g. the aforementioned ncurses library) and not by the compiler itself.
 
  


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
graphics programming with gcc mamta_k Linux - Software 1 06-01-2004 07:28 AM
gcc programming gazza Linux - Newbie 3 02-13-2004 01:21 AM
"ANSI C free manual for programming referance bill icse Programming 0 08-04-2003 11:18 AM
i need gcc manual surya123 Programming 5 07-09-2003 06:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:04 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