Undefined symbols trying to build gdb 6.4

Posted on 2006-04-12
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
    LVL 38

    Accepted Solution

    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

    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 :-)
    LVL 6

    Expert Comment

    Be sure to have your OS up to date on patches:

    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

    I went to the 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 :-)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
    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 find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

    758 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

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now