Subject: libvorbis using wrong library
To: None <tech-pkg@netbsd.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 10/03/2001 19:02:35
Please note that I have a working libvorbis-1.0beta4 installed under
/usr/local/lib/.

Today, I tried to use vorbis-tools-1.0.0.6 package (1.0rc2) which needs
libvorbis-1.0.0.6 package (1.0rc2).

Notice below the reference to -lm /usr/local/lib/libogg.a:

Making all in examples
/bin/sh ../libtool --mode=link cc  -O20 -D__NO_MATH_INLINES -fsigned-char -I/usr
/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2 -DUSE_MEMORY_H -static -
o chaining_example  chaining_example.o ../lib/libvorbisfile.la
../lib/libvorbis.
la -lm -L/lib -logg
cc -O20 -D__NO_MATH_INLINES -fsigned-char
-I/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/include -O2
-DUSE_MEMORY_H -o chaining_example chaining_example.o
../lib/.libs/libvorbisfile.a
-L/usr/pkg/pkgsrc/audio/libvorbis/work/.buildlink/lib -L/lib
../lib/.libs/libvorbis.a -lm /usr/local/lib/libogg.a
../lib/.libs/libvorbisfile.a(vorbisfile.o): In function
`ov_pcm_seek_page':
vorbisfile.o(.text+0x1939): undefined reference to `ogg_stream_packetpeek'
../lib/.libs/libvorbisfile.a(vorbisfile.o): In function `ov_pcm_seek':
vorbisfile.o(.text+0x1aa1): undefined reference to `ogg_stream_packetpeek'
collect2: ld returned 1 exit status

From a quick look I couldn't find local/lib in any makefiles or
configure-related files.

When I moved the old libogg.a, I received:
  cc: /usr/local/lib/libogg.a: No such file or directory

So I looked closer:

libvorbis/work/libvorbis-1.0rc2/lib/.libs/libvorbis.la
libvorbis/work/libvorbis-1.0rc2/lib/.libs/libvorbisfile.lai
libvorbis/work/libvorbis-1.0rc2/lib/libvorbisfile.la

and other .la and .lai files referenced my /usr/local/lib/libogg libaries.

I don't know libtool. How can I make it always use the /usr/pkg/lib/
libraries first?

(Please note that my libogg package is installed and libogg libraries are
installed under /usr/pkg/lib/.)

Or maybe its this new buildlink stuff. Where can I learn more about
utilizing buildlink?

Thanks,

   Jeremy C. Reed
   http://www.reedmedia.net/