This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problems building GDB


Hi,

I have been having problems building GDB, the final link gives an error of
three functions being undefined as follows:

gcc -g -O2        -Wl,--subsystem,console -o gdb.exe \
main.o libgdb.a cli-decode.o cli-script.o cli-cmds.o cli-setshow.o
cli-utils.o mi-out.o mi-console.o mi-cmds.o mi-cmd-var.o mi-cmd-break.o
mi-cmd-stack.o mi-cmd-disas.o mi-main.o mi-parse.o mi-getopt.o gdbtk.o
gdbtk-bp.o gdbtk-cmds.o gdbtk-hooks.o gdbtk-register.o gdbtk-stack.o
gdbtk-varobj.o gdbtk-wrapper.o gdbres.o rdi-share/libangsd.a
../sim/arm/libsim.a ../bfd/libbfd.a ../readline/libreadline.a
../opcodes/libopcodes.a ./../intl/libintl.a ../libiberty/libiberty.a `if
test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a;
else echo -ltermcap; fi`



../libgui/src/libgui.a -L/build/arm/itcl/itcl -lcygitcl32 -L/build/arm/itcl/
itk -lcygitk32 -L/build/arm/tix/win/tcl8.3 -ltix4183 -L/build/arm/tk/win -lc
ygtk83 -L/build/arm/tcl/win -lcygtcl83    -lgdi32 -lcomdlg32 -lm
../libiberty/libiberty.a -luser32 -lshell32 -lgdi32 -lcomdlg32 -ladvapi32\

libgdb.a(utils.o): In function `init_page_info':
/GNU-Source-Code/src/gdb/utils.c:1531: undefined reference to
`_imp__tgetent'
/GNU-Source-Code/src/gdb/utils.c:1537: undefined reference to
`_imp__tgetnum'
/GNU-Source-Code/src/gdb/utils.c:1547: undefined reference to
`_imp__tgetnum'
collect2: ld returned 1 exit status
make[2]: *** [gdb.exe] Error 1


I have tracked these down to the termcap and have built a version of
libtermcap.a that is being picked up by the link line. However, the library
contains the functions as _tgetent and _tgetnum. The objdump of utils.o
shows the functions as _imp__tgetent and _imp__tgetnum so no wonder it fails
to link.

I am building under cgywin and win2K and using the latest CVS version. I
have also tried a snapshot version from 9/11/2001.

My question is how is the compiler making the decision to put _imp_ on the
front of these functions names, and thus how do I stop the compiler from
mangling the functions names. I have assumed that the manglinig is due to
the system trying to use the functions from a .dll but how does the system
specify that a .dll should be used as the source of a function. The line
generating the utils.o file is given below, can anyone check it against a
working compile under cygwin for any differences.

gcc -c -g -O2    -I. -I/GNU-Source-Code/src/gdb -I/GNU-Source-Code/src/gdb/c
onfig -DHAVE_CONFIG_H -I/GNU-Source-ode/src/gdb/../include/opcode -I/GNU-Sou
rce-Code/src/gdb/../readline/.. -I../bfd -I/GNU-Source-Code/src/gdb/../bfd  
-I/GNU-Source-Code/src/gdb/../include -I../intl -I/GNU-Source-Code/src/gdb/.
./intl  -DMI_OUT=1 -DGDBTK -DUI_OUT=1 -Wreturn-type -Wcomment -trigraphs -Wf
ormat -Wparentheses -Wpointer-arith -Wuninitialized
/GNU-Source-Code/src/gdb/utils.c

Thank for any help

Andy Hare
www.ahare.btinternet.co.uk



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]