bug-ncurses
[Top][All Lists]
Advanced

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

error to compile and run ncurses program.


From: Nimish
Subject: error to compile and run ncurses program.
Date: Fri, 13 Jul 2007 23:41:12 -0700 (PDT)

I m new programmer in ncurses. I want to make program for graphics designing
in c++ in linux, someone suggested me for ncurses but i face some problem to
make program on it.

I m using suse 10.1 and install packages => ncurses,
ncurses-devel,yast2-ncurses.

I make a simple program below :-

===============gr1.cc==========================
#include <ncurses.h>
int main()
{
        initscr();                
        printw("Hello World !!!"); 
        refresh();                
        getch();                  
        endwin();                  
        return 0;
}
===================================================

Now I m compiling or runing it then I face problem, I tried to compile it
different - different cammands but I face problem I write that cammands and
errors below:-
---------------------------------------------------------------------------
 
address@hidden:~/cpp_programs> gcc gr1.cc libncurses.a
gcc: libncurses.a: No such file or directory
address@hidden:~/cpp_programs> gcc −lncurses gr1.cc
gcc: −lncurses: No such file or directory
address@hidden:~/cpp_programs> gcc −ncurses gr1.cc
gcc: −ncurses: No such file or directory
address@hidden:~/cpp_programs> gcc gr1.cc
/tmp/cchTbEjC.o: In function `main':
gr1.cc:(.text+0x12): undefined reference to `initscr'
gr1.cc:(.text+0x1e): undefined reference to `printw'
gr1.cc:(.text+0x23): undefined reference to `refresh'
gr1.cc:(.text+0x28): undefined reference to `stdscr'
gr1.cc:(.text+0x30): undefined reference to `wgetch'
gr1.cc:(.text+0x35): undefined reference to `endwin'
/tmp/cchTbEjC.o:(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status

address@hidden:~/cpp_programs/ncurses/c++> gcc −curses gr1.cc
gcc: −curses: No such file or directory

------------------------------------------------------------------------------------
I also run this program in anjuta too and error comes are below :-
/tmp/cchTbEjC.o: In function `main':
gr1.cc:(.text+0x12): undefined reference to `initscr'
gr1.cc:(.text+0x1e): undefined reference to `printw'
gr1.cc:(.text+0x23): undefined reference to `refresh'
gr1.cc:(.text+0x28): undefined reference to `stdscr'
gr1.cc:(.text+0x30): undefined reference to `wgetch'
gr1.cc:(.text+0x35): undefined reference to `endwin'
/tmp/cchTbEjC.o:(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status
--------------------------------------------------------------------------------
==============================================================

tell me whats the problem should I install more packages or I used another
command for compile/run or any error  in my program. 
Also tell me if any buddy knows how to run this on anjuta in suse linux 10.1
Thanks in advance!
-- 
View this message in context: 
http://www.nabble.com/error-to-compile-and-run-ncurses-program.-tf4078187.html#a11591554
Sent from the Gnu - Ncurses mailing list archive at Nabble.com.





reply via email to

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