The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Undefined symbol: .log ravindra_maddal AIX 0 05-15-2008 04:30 AM
undefined symbol: clock_gettime' error dpa078 High Level Programming 4 04-09-2008 06:29 AM
shared object "undefined symbol: fstat" error marcus121 High Level Programming 5 04-24-2006 04:11 PM
fread64 fwrite64 compilation problem (undefined symbol) Isax50 High Level Programming 3 08-16-2005 12:26 AM
ld: 0711-317 ERROR: Undefined symbol: .hello stockdan High Level Programming 2 11-25-2003 01:43 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-21-2006
Registered User
 

Join Date: Feb 2005
Posts: 71
Question Undefined symbol: .getcury in getyx

Iam attempting a script to return the current cursor position using the getyc macro

I have #included the curses.h

however on compilation (with gcc) it errors with

Undefined symbol .getcury
Undefined symbol .gercurx

Any ideas where I can find a solution or what I've missed
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-21-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,475
Quote:
Iam attempting a script to return the current cursor position using the getyc macro
there is no getyc macro and only getyx macro available
did u compile with -lcurses option?

If you still have problem.

Please post your code!!!
Reply With Quote
  #3 (permalink)  
Old 03-22-2006
Registered User
 

Join Date: Feb 2005
Posts: 71
Red face

I have now !, many thanks for your advice.

Last edited by gefa; 03-23-2006 at 12:44 AM.
Reply With Quote
  #4 (permalink)  
Old 03-23-2006
Registered User
 

Join Date: Feb 2005
Posts: 71
Question

I do have one further issue however, the line is returned 16424 and the column as 9001 no matter where the cusror is ?

The code is very basic but reads as follows;


#include <curses.h>
int rvline, rvcolumn;
main()
{
WINDOW *my_window;
getyx(my_window, rvline, rvcolumn);
printf ("The line is %i\n", rvline);
}
Reply With Quote
  #5 (permalink)  
Old 03-23-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,475
yes it will display some junk value,

you are still not in graphics mode and still in console mode,

initialize graphics mode and find the cursor position !!!

man initscr
and
man endwin

for details
Reply With Quote
  #6 (permalink)  
Old 03-24-2006
Registered User
 

Join Date: Feb 2005
Posts: 71
Question

Thanks for the info, read the man pages but not sure how and where to put the subroutine in the script

I've put it at the top, but being fairly new and a bit of a novice to C I'm not confident

#include <stdio.h>
#include <curses.h>

WINDOW *initscr(void);
SCREEN *newterm(char *type,
FILE *outfile,
FILE *infile);
initscr();

main()
{
int rvline, rvcolumn;
WINDOW *my_window;
getyx(my_window, rvline, rvcolumn);
printf ("The line is %i\n", rvline);
}

compilation errors

CursorPos.c:7: conflicting types for `initscr32'
CursorPos.c:3: previous declaration of `initscr32'
CursorPos.c:7: warning: data definition has no type or storage class
Reply With Quote
  #7 (permalink)  
Old 03-24-2006
Technorati Master
 

Join Date: Mar 2005
Location: Large scale systems...
Posts: 2,475
Quote:
WINDOW *initscr(void);
SCREEN *newterm(char *type,
FILE *outfile,
FILE *infile);
initscr();
functions redeclared and conflicting with the prototypes;
and still you have not invoked the graphics mode and still in console mode.

Try the following code,
Code:
#include <stdio.h>
#include <curses.h>

int main()
{
  int rvline, rvcolumn;
  WINDOW *my_window;
  my_window=initscr();
  getyx(my_window, rvline, rvcolumn);
  wprintw(my_window, "prior to cur movement %d %d\n", rvline, rvcolumn);

  getyx(my_window, rvline, rvcolumn);
  wprintw(my_window, "after to cur movement %d %d\n", rvline, rvcolumn);

  wprintw(my_window, "CURSOR");
  getyx(my_window, rvline, rvcolumn);
  wprintw(my_window, "\nafter to cur movement %d %d\n", rvline, rvcolumn);
  getch();
  endwin();
  return 0;
}
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0