Chris Bagwell <ch...@cnpbagwell.com>:
flac-1.2.1/src/libFLAC/bitwriter.c:286: undefined reference to
`_imp__ntohl@4'
I haven't found time to look into it yet but the reason I made that change
to mingwbuild is because of sox git commit
d0647a4f8650f92057274f2412bb8aa79f71a242 . If I recall correctly, I was
getting duplicate symbol failure.
I obvious didn't realize I was totally disabling FLAC/libsndfile. I thought
I was getting rid of duplicate symbol.
So any fix is likely more than a compile change.
Ah, I see. I have a few ideas that I'd like to try out, unfortunately
I can't get cross-compiling to work here (not enough motivation
either, I guess). Here are two patches, but I can't say whether one of
them really solves the problem:
- One reverts the relevant part of commit d0647a4. It then should be
possible again to link against wsock32.dll as done in previous releases.
- The other one removes the -no-undefined flag (commit d0647a4 did
this, too, but it has since found its way back) in the hope that this
will allow the linker to match the ntohl() call from libflac and the
definition from src/flac.c.
Ulrich
>From b4f833707729d52d720c37736fc6121569b884ba Mon Sep 17 00:00:00 2001
From: Ulrich Klauer <ulr...@chirlu.de>
Date: Sun, 10 Feb 2013 15:56:13 +0100
Subject: [PATCH] Link Windows build to wsock32.dll again
Link the Windows build to wsock32.dll for ntohl() again instead of
trying to provide an own implementation.
(Partial revert of commit d0647a4f8650f92057274f2412bb8aa79f71a242.)
---
configure.ac | 5 +++++
src/flac.c | 8 --------
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/configure.ac b/configure.ac
index ea7fd11..48e8ca2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -437,6 +437,11 @@ AC_OPTIONAL_FORMAT(oggvorbis, OGG_VORBIS, [AC_CHECK_HEADER(vorbis/codec.h,
# support for OGG and if OGG libraries are found on this
# system then its highly likely to be compiled into FLAC
# and will require these at link time.
+case $target in
+ *mingw*)
+ FLAC_LIBS="-lwsock32"
+ ;;
+esac
AC_OPTIONAL_FORMAT(flac, FLAC, [AC_CHECK_HEADER(FLAC/all.h, [AC_CHECK_DECL(FLAC_API_VERSION_CURRENT, [AC_CHECK_LIB(FLAC, FLAC__stream_encoder_new, FLAC_LIBS="-lFLAC $FLAC_LIBS $OGG_VORBIS_LIBS",using_flac=no, $FLAC_LIBS $OGG_VORBIS_LIBS)], using_flac=no, [#include <FLAC/all.h>])], using_flac=no)], using_flac=no)
diff --git a/src/flac.c b/src/flac.c
index eff2ae4..2eba0f1 100644
--- a/src/flac.c
+++ b/src/flac.c
@@ -55,14 +55,6 @@ typedef struct {
} priv_t;
-#if defined(__MINGW32__)
-/* Provide a local definition of ntohl so we don't need to load wsock32.dll. */
-unsigned long __stdcall ntohl(unsigned long val)
-{
- return lsx_swapdw(val);
-}
-#endif
-
static void FLAC__decoder_metadata_callback(FLAC__StreamDecoder const * const flac, FLAC__StreamMetadata const * const metadata, void * const client_data)
{
--
1.7.10.4
>From 007a085ce9348c24df0d08d117c6b0a4bf9b7eb1 Mon Sep 17 00:00:00 2001
From: Ulrich Klauer <ulr...@chirlu.de>
Date: Sun, 10 Feb 2013 16:10:43 +0100
Subject: [PATCH] Remove -no-undefined flag for MinGW build
Remove the -no-undefined linker flag for MinGW builds. Hopefully, this
will allow the linker to match the ntohl() call from libflac and the
definition provided in src/flac.c.
---
configure.ac | 1 -
1 file changed, 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index ea7fd11..62d784d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,7 +46,6 @@ AC_LIBTOOL_DLOPEN
case $target in
*cygwin* | *mingw*)
AC_LIBTOOL_WIN32_DLL
- APP_LDFLAGS="-no-undefined"
;;
esac
AC_PROG_LIBTOOL
--
1.7.10.4
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel