bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem in linking ncurses with gcc on Solaris SPARC


From: Syed Enam-ur-Rehman
Subject: Problem in linking ncurses with gcc on Solaris SPARC
Date: Thu, 11 Mar 2004 17:29:00 -0800

Hi,
 
I have been trying to compile a program using ncurses 5.3 with gcc 3.3.2 on  a SPARC machine with Solaris 8, but it reports symbol refrencing errors.
 
I am using :
 
# g++ -lncurses myProgram.c
 
and it reports:
 
Undefined                       first referenced
Symbol                                in file
initscr32                         /var/tmp//ccMr7Ns8.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
 
I have successfully compiled it on Red Hat Linux 7.2. I have also tried gcc 2.95.3, but it produces same error on Solaris SPARC. The code compiles fine with curses i.e linking -lcurses. Forte Developer 6 compiles it as well (not sure which library and compiler does it use), but how would I do it using gcc in command line?
 
Any help will be appreciated,
 
Enam
 
 
Here is the code I am trying to compile :

#include <stdio.h>

#include <curses.h>

#include <string.h>

#include <unistd.h>

int main()

{

WINDOW * w1;

WINDOW * w2;

WINDOW * w3;

int x1 = 0;

int y1 = 0;

int x2 = 0;

int y2 = 0;

int loop = 0;

char * str = (char *) malloc(1024);

w1 = initscr();

cbreak();

noecho();

w2 = newwin(20, 20, 1, 59);

w3 = newwin(5, 40, 1, 5);

wborder(w1, 0, 0, 0, 0, 0, 0, 0, 0);

mvwaddstr(w1, 0, 31, "LionHeart Systems");

//wrefresh(w1);

//wrefresh(w2);

//wrefresh(w3);

do

{

sprintf(str, "Message : %d\n", loop);

if(y1 > 19)

{

y1 = 0;

wclear(w2);

}

mvwaddstr(w2, y1++, x1, str);

wrefresh(w2);

sprintf(str, "Transmitting Satellite Message # : %d", loop++);

if(y2 > 4)

{

y2 = 0;

wclear(w3);

}

mvwaddstr(w3, y2++, x2, str);

wrefresh(w3);

sleep(1);

}

//while(getch() != 27);

while(1);

delwin(w2);

delwin(w3);

delwin(w1);

endwin();

return 0;

}


reply via email to

[Prev in Thread] Current Thread [Next in Thread]