-   Linux - Newbie (
-   -   Weirdness in ld behaviour (

NoWone 09-22-2008 01:05 PM

Weirdness in ld behaviour
I'm trying to compile libnewt. I'm on slackware 12.1. After the configure step I go with make and I get:


root@camelot:~/newt/newt-0.52.2# make
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o test.o test.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang -DVERSION=\"0.52.1\" -c -o newt.o newt.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o button.o button.c
button.c: In function 'buttonEvent':
button.c:149: warning: 'er.result' may be used uninitialized in this function
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o form.o form.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o checkbox.o checkbox.c
checkbox.c: In function 'cbEvent':
checkbox.c:210: warning: 'er.result' may be used uninitialized in this function
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o entry.o entry.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o label.o label.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o listbox.o listbox.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o scrollbar.o scrollbar.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o textbox.o textbox.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o scale.o scale.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o grid.o grid.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o windows.o windows.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o buttonbar.o buttonbar.c
cc  -Wall  -D_GNU_SOURCE -g -O2 -DUTF8 -fPIC -I/usr/include/slang  -c -o checkboxtree.o checkboxtree.c
checkboxtree.c: In function 'ctDraw':
checkboxtree.c:526: warning: 'currRow' is used uninitialized in this function
checkboxtree.c:449: warning: 'spaces' may be used uninitialized in this function
ar rv libnewt.a newt.o button.o form.o checkbox.o entry.o label.o listbox.o scrollbar.o textbox.o scale.o grid.o windows.o buttonbar.o checkboxtree.o
ar: creating libnewt.a
a - newt.o
a - button.o
a - form.o
a - checkbox.o
a - entry.o
a - label.o
a - listbox.o
a - scrollbar.o
a - textbox.o
a - scale.o
a - grid.o
a - windows.o
a - buttonbar.o
a - checkboxtree.o
cc -g -o test test.o libnewt.a -lslang -lm -ldl  -static
/usr/lib/gcc/i486-slackware-linux/4.2.3/../../../../i486-slackware-linux/bin/ld: cannot find -lslang
collect2: ld returned 1 exit status
make: *** [test] Error 1

libslang files are in /usr/lib

root@camelot:~/newt/newt-0.52.2# ls /usr/lib/libslang*
/usr/lib/    /usr/lib/*  /usr/lib/*
/usr/lib/  /usr/lib/      /usr/lib/

and with ldconfig -p I get:

root@camelot:~/newt/newt-0.52.2# ldconfig -p|grep slang (libc6) => /usr/lib/ (libc6) => /usr/lib/ (libc6) => /usr/lib/

the library IS there... what am I missing?

Thank you in avance!

Valery Reznic 09-23-2008 03:09 AM


cc -g -o test test.o libnewt.a -lslang -lm -ldl  -static

You make static link. In this case ld looks for libslang.a
You'll need to install this library (or make dynamic link)

All times are GMT -5. The time now is 04:04 AM.