Undefined symbols trying to build gdb 6.4

Posted on 2006-04-12
Medium Priority
Last Modified: 2013-12-27
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?


Question by:peparsons
  • 2
LVL 38

Accepted Solution

yuzh earned 2000 total points
ID: 16442092
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:

Author Comment

ID: 16443181
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 :-)

Expert Comment

ID: 16445599
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.

Author Comment

ID: 16486130
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 :-)


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month15 days, 3 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question