Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-22-2008, 01:05 PM   #1
LQ Newbie
Registered: Jan 2005
Location: Italy
Distribution: Slackware
Posts: 18

Rep: Reputation: 0
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!
Old 09-23-2008, 03:09 AM   #2
Valery Reznic
ELF Statifier author
Registered: Oct 2007
Posts: 674

Rep: Reputation: 134Reputation: 134
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)


compile error, ld, ldconfig, make, slackware

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH weirdness sardaukar_siet Linux - Networking 2 11-07-2006 04:31 PM
Mouse weirdness springsteenfan Linux - Laptop and Netbook 1 03-01-2005 04:47 AM
Wu-ftp Weirdness chris Linux - General 2 07-22-2003 05:03 PM
Grub Weirdness keating_5 Linux - General 0 07-01-2003 11:59 PM
iptables weirdness Misteree Linux - Security 8 05-27-2003 05:13 PM

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

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration