programming w/ curses

programming w/ curses

Post by Edward Pa » Tue, 11 Aug 1998 04:00:00

I'm trying to write a C program using the curses library and I'm getting
quite frustrated with linker errors.

I wrote the following simple program:

#include <curses.h>
int main(void)
        return 0;


and I get an error that says that initscr32 is undefined.  I looked in
/usr/include/curses.h and found a line that says:

#define initscr initscr32

I looked for the library file.  It is not in /usr/lib, but instead in
/usr/ccs/lib (/usr/ccs/lib/libcurses.a).  So I specified that directory
on the command line during compilation and it still doesn't work.  I
tried copying /usr/ccs/lib/libcurses.a to /usr/lib and that doesn't work

I'm using GCC v. with the following line (on Solaris 2.5.1):

gcc -L/usr/ccs/lib -lcurses main.c

Does anyone have a clue?

(Replies by email would be greatly appreciated)

-Eddie Pan


programming w/ curses

Post by Casper H.S. Dik - Network Security Engine » Wed, 12 Aug 1998 04:00:00


>I'm using GCC v. with the following line (on Solaris 2.5.1):
>gcc -L/usr/ccs/lib -lcurses main.c

The -L option isn't needed.  But libraries must be put after object files/source:

        gcc main.c -lcurses

Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


1. curses curses curses

Last year I developed a curses based program on my SUN IPC (Sunos 4.1.2).
Sunos 4.1.2 has a SysV version of curses, that is the version I used.
I recently tried to compile my program with the new SUN C compiler
(version 2.0.1 I think).  The curses routines that come with this compiler
are BSD routines.  BSD curses and SysV curses do not seem to be compatible.
The compilation crashed (unrecognized symbols being a glaring problem).
I logged into a Solaris 2.1 based SUN that also had the new Sun C compiler
installed, and it too had BSD curses.

I would like to know why Sun chose BSD curses for their C compiler.  I
thought they would surely use SysV curses for Solaris 2.x, since it is
SysV based (or does SVR4 use BSD curses by default?).

Is the source for SysV curses available via anon ftp?

Thanks for any help you can send.


2. Looking for

3. Need help programming in curses.

4. 3c509 mcast:host is down

5. Curses programming

6. FreeBSD, Linux & Windows

7. define Control+PageUp for curses program

8. Unix - Frequently Asked Questions (Contents) [Frequent posting]

9. HELP!!!! Menu program that uses curses

10. (curses)window struct destroyed under multiprocesses program?

11. system()'ing a curses app from a curses app

12. Curses?. . .Curses!

13. Help on Curses Programming