ld: 0711-317 ERROR: Undefined symbol: stdscr

I am trying to compile pro*c program on aix 5.3. The program compiled fine when I was using curses library. After switching to ncurses, I have started getting compilation errors. After installing ncurses on the box, I changed the -lcurses flag to -lncurses. I have also updated the path to the ncurses library in the make file. Any one has any ideas on how to solve this? Thanks.

ld: 0711-317 ERROR: Undefined symbol: stdscr
ld: 0711-317 ERROR: Undefined symbol: .wmove
ld: 0711-317 ERROR: Undefined symbol: .wprintw
ld: 0711-317 ERROR: Undefined symbol: .wrefresh
ld: 0711-317 ERROR: Undefined symbol: .noraw
ld: 0711-317 ERROR: Undefined symbol: .endwin
ld: 0711-317 ERROR: Undefined symbol: .initscr
ld: 0711-317 ERROR: Undefined symbol: .cbreak
ld: 0711-317 ERROR: Undefined symbol: .nonl
ld: 0711-317 ERROR: Undefined symbol: .noecho
ld: 0711-317 ERROR: Undefined symbol: .keypad
ld: 0711-317 ERROR: Undefined symbol: .wclear
ld: 0711-317 ERROR: Undefined symbol: .wattr_on
ld: 0711-317 ERROR: Undefined symbol: .wattr_off
ld: 0711-317 ERROR: Undefined symbol: .wgetch
ld: 0711-317 ERROR: Undefined symbol: .printw
ld: 0711-317 ERROR: Undefined symbol: .wclrtoeol
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
make: The error code from the last command is 8.

Are you calling initscr before anything else in your main function...initscr should be the first statement there and endwin should be the last call prior to returning.

Yes initscr is the first and endwin is the last function call in main. Thanks.

Can you post the code to show what's going on...also what compiler are you using.

We are using compiler xlc_r version 7 on AIX with Oracle 11g precomplier for pro*c. Code is over 2500 lines and the error does not pin point where the it is comming from.

All these symbols are part of ncurses so it looks like the compiler isnt picking up the libncurses library. Do you know where it is installed and make sure that the -L path to it is correct. You can try removing and reinstalling ncurses in case something got missed during the first install...though from the error it looks like the compiler is not able to find the ncurses library. Can you show atleast the command you are giving for compilation.

Here is the part of the make file:

# Link flags
LDFLAGS=-L$(LIBHOME) -L$(ICU)/lib -L/usr/local/lib -L/usr/lib -L$(GOBJ) $(LINKTM)
LLIBCURSES = /opt/freeware/lib/libncurses.a #i have also used -lncurses
--other libs here
LLIBS= $(PROLDLIBS) $(LLIBCURSES)

.c:
$(CC) $(CFLAGS) $.c -c $(CCOPT)
$(CP) $(CFLAGS) $
.o -o $* $(LOBJS) $(LDFLAGS) $(LLIBS) $(CCOPT)

ncurses library is located under //opt/freeware/lib. /usr/lib contains most of the libraries as well as hard link to ncurses.
/usr/lib> ls -ltr *ncur*
lrwxrwxrwx 1 root system 35 Jun 24 17:17 libncurses.a -> ../../opt/freeware/lib/libncurses.a

Thanks.

Have you tried libncursesw? It looks like some of the missing functions are wide-character ones.

You are linking to the archive version of ncurses lib without telling the compiler to do so. Are there any shared libs under /opt/freeware/lib named libncurses.so because you need that not the libncurses.a which is the achive version.

There is no libncurses.so file under that folder. How do I tell the compiler to use the archive? I have tried using -lncurses and -L/path_to-archive. Thanks.

have you tried -lncursesw ?

I have not tried -lncursesw. i dont think the library is installed. I will need to ask systems to install it. All the missing symbols are a part of ncurses.h file so it should work once the file is included and library is linked.

Use -bstatic to build a static executable.

On my system at least there is a separate libncurses and libncursesw provided by one ncurses package, so it might be worth a shot. Its also possible that these wide-character functions are an optional feature that your distributor did not compile in...