Undefined symbols trying to build gdb 6.4

I need to build a more recent version of gdb (version 6.4), so I downloaded it and tried to build it.
The linking failed as follows:

gcc -g -O2        \
        -o gdb gdb.o libgdb.a \
           ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libbfd.a  ../libiberty/libiberty.a     -ldl -lncurses -lsocket -lnsl -lm -liconv ../libiberty/libiberty.a  
Undefined                       first referenced
 symbol                             in file
getcurx                             libgdb.a(tui-io.o)
getcury                             libgdb.a(tui-io.o)
w32attron                           libgdb.a(tui-wingeneral.o)
w32attroff                          libgdb.a(tui-wingeneral.o)
touchwin                            libgdb.a(tui-regs.o)
acs32map                            libgdb.a(tui-win.o)
w32addch                            libgdb.a(tui-io.o)
initscr32                           libgdb.a(tui.o)
ld: fatal: Symbol referencing errors. No output written to gdb
collect2: ld returned 1 exit status

The system is Solaris 8.
I'm guessing that these symbols are from the curses or ncurses library.
If I look in the first directory listed in ${LD_LIBRARY_PATH} there is a file called libncurses.a and a symbolic link to it called libcurses.a.
(I have no idea what version of curses this library is or how to find out.)
I've had a look for other people reporting the same problem, without success. So, I'm inclined to think it's something I'm doing wrong.

Any ideas how to fix this please?


Who is Participating?
Have a look at your installation doc (README file etc) to see if any depandecies
package missing, eg: libiconv package

Why not download gdb 6.0 binary (need libiconv as well) from:
peparsonsAuthor Commented:
Thanks for your suggestions, yuzh. I think this is quite a difficult problem and I wasn't sure whether anybody would be able to help.

While waiting for a response I tried downloading, building and installing the latest version of ncurses. It took quite a long time, but that installation did work OK. Unfortunately, I won't be able to try anything else until next Tuesday, so don't think I've forgotten you :-)
Be sure to have your OS up to date on patches: http://sunsolve.sun.com/pub-cgi/show.pl?target=patches/patch-access

Check your dependencies with 'ldd -d <binary>'  - this helps in determining if your LD_LIBRARY_PATH is correct for compiling.

Like yuzh suggested, you may want to get both the latest version of gdb (6.0) and ncurses (5.4) from sunfreeware.
peparsonsAuthor Commented:
I went to the sunfreeware.com web site and followed the instructions to download and install pkg-get and wget.
The biggest challenge was to correctly configure pkg-get by editing /opt/csw/etc/pkg-get.conf
(I had to tell it to use an office proxy with a correct username and password.)
Then it all worked really nicely :-)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.