Skip to content

Instantly share code, notes, and snippets.

@sitedyno
Created September 26, 2012 19:27
Show Gist options
  • Save sitedyno/3790027 to your computer and use it in GitHub Desktop.
Save sitedyno/3790027 to your computer and use it in GitHub Desktop.
Problem linking against vorbisenc in cygwin.
$ ./configure
checking for c++ compiler ... OK
checking for compile with PortAudio ... OK
checking for link with PortAudio ... OK
checking for fltk-config ... OK
checking for compile with fltk ... OK
checking for fltk has FL_GTK_UP_BOX ... OK
checking for link with fltk ... OK
checking for compile with libvorbis ... OK
checking for link with libvorbis ... FAILED
checking for compile with libmp3lame (lame) ... OK
checking for link with libmp3lame (lame) ... OK
configure summary
ogg support: NO
mp3 support: YES
You may run "make" now
################# The check configure uses:
check_libvorbis() {
cat << EOF >tmp.c
#include <vorbis/vorbisenc.h>
int main() {
vorbis_info vi;
vorbis_info_init(&vi);
return 0;
}
EOF
msg_chkfor "compile with libvorbis"
if ${CXX} -c tmp.c -o /dev/null 2>&3
then
echo "OK"
msg_chkfor "link with libvorbis"
if ${CXX} tmp.c -o /dev/null -lvorbisenc 2>&3
then
echo "OK"
echo "#_______________________" >&4
echo "WITH_LIBVORBIS:=1" >&4
echo "CXXFLAGS_LIBVORBIS:=" >&4
echo "CXXFLAGS+=$vorbis_header" >&4
echo "LDFLAGS+=$vorbis_lib" >&4
[ "$STATIC" -eq 0 ] && echo "LIBS_LIBVORBIS:=-lvorbisenc" >&4
echo "SRC_LIBVORBIS:=vorbis_encode.cpp" >&4
echo "" >&4
OGG=1
else
echo "FAILED"
echo "WITH_LIBVORBIS:=0" >&4
fi
else
echo "FAILED"
echo "WITH_LIBVORBIS:=0" >&4
fi
}
############# Runnig gcc on the tmp file as defined above:
$ gcc tmp.c -o tmp.o -lvorbisenc
/tmp/cca5vP2B.o:tmp.c:(.text+0x16): undefined reference to `_vorbis_info_init'
collect2: ld returned 1 exit status
############# Include files exist:
$ cd /usr/include/vorbis/
$ ls
codec.h vorbisenc.h vorbisfile.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment