As a note, with the latest versions, I get this "new" failure, when cross compiling for windows using mingw: CCLD speexdec.exe speexdec.o:speexdec.c:(.text+0x4af): undefined reference to `_imp__waveOutGetNumDevs at 0' speexdec.o:speexdec.c:(.text+0x54d): undefined reference to `_imp__waveOutOpen at 24' speexdec.o:speexdec.c:(.text+0x5aa): undefined reference to `_imp__waveOutReset at 4' speexdec.o:speexdec.c:(.text+0x7f1): undefined reference to `_imp__waveOutUnprepareHeader at 12' speexdec.o:speexdec.c:(.text+0x8f2): undefined reference to `_imp__waveOutPrepareHeader at 12' speexdec.o:speexdec.c:(.text+0x913): undefined reference to `_imp__waveOutWrite at 12' speexdec.o:speexdec.c:(.text+0xa45): undefined reference to `_imp__waveOutUnprepareHeader at 12' speexdec.o:speexdec.c:(.text+0xaae): undefined reference to `_imp__waveOutReset at 4' speexdec.o:speexdec.c:(.text+0xabf): undefined reference to `_imp__waveOutClose at 4' collect2: error: ld returned 1 exit status Makefile:445: recipe for target 'speexdec.exe' failed Cheers!
Hi, On Fri, Jul 8, 2016 at 6:41 PM, Roger Pack <rogerdpack2 at gmail.com> wrote:> As a note, with the latest versions, I get this "new" failure, when > cross compiling for windows using mingw: > > CCLD speexdec.exe > speexdec.o:speexdec.c:(.text+0x4af): undefined reference to > `_imp__waveOutGetNumDevs at 0' > speexdec.o:speexdec.c:(.text+0x54d): undefined reference to > `_imp__waveOutOpen at 24' > speexdec.o:speexdec.c:(.text+0x5aa): undefined reference to > `_imp__waveOutReset at 4' > speexdec.o:speexdec.c:(.text+0x7f1): undefined reference to > `_imp__waveOutUnprepareHeader at 12' > speexdec.o:speexdec.c:(.text+0x8f2): undefined reference to > `_imp__waveOutPrepareHeader at 12' > speexdec.o:speexdec.c:(.text+0x913): undefined reference to > `_imp__waveOutWrite at 12' > speexdec.o:speexdec.c:(.text+0xa45): undefined reference to > `_imp__waveOutUnprepareHeader at 12' > speexdec.o:speexdec.c:(.text+0xaae): undefined reference to > `_imp__waveOutReset at 4' > speexdec.o:speexdec.c:(.text+0xabf): undefined reference to > `_imp__waveOutClose at 4' > collect2: error: ld returned 1 exit status > Makefile:445: recipe for target 'speexdec.exe' failedThese waveOut* functions are MS specific, so for some reason you are not linking against the appropriate library for audio routines (I'm guessing the winmm library?) Can you provide your full config.log and any other pertinent logs? Best, Tristan
Tristan Matthews
2016-Jul-09 21:07 UTC
[Speex-dev] [PATCH] autotools: fix linking for building speexdec with mingw
This patch should address the current linking failure for speexdec with mingw. --- configure.ac | 3 +++ src/Makefile.am | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index c4b357e..1659062 100644 --- a/configure.ac +++ b/configure.ac @@ -194,9 +194,12 @@ AC_ARG_ENABLE(blackfin-asm, [ --enable-blackfin-asm Make use of Blackfin asse [if test "$enableval" = yes; then AC_DEFINE([BFIN_ASM], , [Make use of Blackfin assembly optimizations]) fi]) +WINMM_LIBS="" case $host_os in uclinux) LDFLAGS="-Wl,-elf2flt=-s100000 $LDFLAGS";; + *mingw*) WINMM_LIBS="-lwinmm";; esac +AC_SUBST(WINMM_LIBS) AC_ARG_ENABLE(fixed-point-debug, [ --enable-fixed-point-debug Debug fixed-point implementation], [if test "$enableval" = yes; then diff --git a/src/Makefile.am b/src/Makefile.am index 2cac269..ce870ac 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,5 +24,5 @@ speexenc_LDADD = $(top_builddir)/libspeex/libspeex.la \ speexdec_SOURCES = speexdec.c wav_io.c speexdec_LDADD = $(top_builddir)/libspeex/libspeex.la \ - $(OGG_LIBS) @FFT_LIBS@ + $(OGG_LIBS) @WINMM_LIBS@ @FFT_LIBS@ -- 2.8.1
Hi Roger,> > On Fri, Jul 8, 2016 at 6:41 PM, Roger Pack <rogerdpack2 at gmail.com> wrote: >> As a note, with the latest versions, I get this "new" failure, when >> cross compiling for windows using mingw: >> >> CCLD speexdec.exe >> speexdec.o:speexdec.c:(.text+0x4af): undefined reference to >> `_imp__waveOutGetNumDevs at 0' >> speexdec.o:speexdec.c:(.text+0x54d): undefined reference to >> `_imp__waveOutOpen at 24' >> speexdec.o:speexdec.c:(.text+0x5aa): undefined reference to >> `_imp__waveOutReset at 4' >> speexdec.o:speexdec.c:(.text+0x7f1): undefined reference to >> `_imp__waveOutUnprepareHeader at 12' >> speexdec.o:speexdec.c:(.text+0x8f2): undefined reference to >> `_imp__waveOutPrepareHeader at 12' >> speexdec.o:speexdec.c:(.text+0x913): undefined reference to >> `_imp__waveOutWrite at 12' >> speexdec.o:speexdec.c:(.text+0xa45): undefined reference to >> `_imp__waveOutUnprepareHeader at 12' >> speexdec.o:speexdec.c:(.text+0xaae): undefined reference to >> `_imp__waveOutReset at 4' >> speexdec.o:speexdec.c:(.text+0xabf): undefined reference to >> `_imp__waveOutClose at 4' >> collect2: error: ld returned 1 exit status >> Makefile:445: recipe for target 'speexdec.exe' failedShould be fixed in master now, let me know if you have any futher issues.[1][2] Best, Tristan [1] https://git.xiph.org/?p=speex.git;a=commit;h=b35c295682a3d257ddef4abb8d76e8c7aeff358c [2] https://git.xiph.org/?p=speex.git;a=commit;h=497db349f47350a62ba42a91c10d7e203e64d167