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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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 :-)

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.