Hi Sean,

You may find that the attached patch helps. Builds perfectly here using it.

John

On 17/11/2010 14:02, Sean Pappalardo wrote:
Hello everyone.

Due to problems with libsndfile's handling of FLAC files, Mixxx is
going to use libFLAC directly in v1.9.0. I'm the Windows packager and
am trying to build libFLAC on Windows x64 using MSVC 2008 and the
following steps that I've put together:
http://mixxx.org/wiki/doku.php/build_windows_dependencies#libflac

The problems I have are the following:

If I try to build the dynamic version, I get two unresolved externals:
bitreader_asm.obj : error LNK2001: unresolved external symbol _FLAC__crc16_table
bitreader_asm.obj : error LNK2001: unresolved external symbol
_bitreader_read_from_client_
..\..\obj\release\lib\libFLAC_dynamic.dll : fatal error LNK1120: 2
unresolved externals

I can build the static version fine, but when Mixxx tries to link it
in, I get different unresolved externals:
soundsourceflac.obj : error LNK2001: unresolved external symbol
__imp_FLAC__stream_decoder_process_single
soundsourceflac.obj : error LNK2001: unresolved external symbol
__imp_FLAC__stream_decoder_seek_absolute
soundsourceflac.obj : error LNK2001: unresolved external symbol
__imp_FLAC__stream_decoder_delete
soundsourceflac.obj : error LNK2001: unresolved external symbol
__imp_FLAC__stream_decoder_finish
soundsourceflac.obj : error LNK2001: unresolved external symbol
__imp_FLAC__stream_decoder_process_until_end_of_metadata
soundsourceflac.obj : error LNK2001: unresolved external symbol
__imp_FLAC__stream_decoder_init_stream
soundsourceflac.obj : error LNK2001: unresolved external symbol
__imp_FLAC__stream_decoder_get_state
soundsourceflac.obj : error LNK2001: unresolved external symbol
__imp_FLAC__stream_decoder_new

Any ideas on what I can try next? Thanks for your time and work on
such an awesome codec! (I just wish more US car stereos used it.)

Sincerely,
Sean M. Pappalardo
"D.J. Pegasus"
Mixxx Developer
_______________________________________________
Flac-dev mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/flac-dev

1) set preprocessor definition FLAC__HAS_NASM to FLAC__NO_ASM for the 
libFLAC_static project
2) set preprocessor definition FLAC__CPU_IA32 to FLAC__CPU_AMD64 (don't know if 
this is necessary, seemed logical to do smile.gif)
2) apply patch http://osdir.com/ml/comp.audio.compression...5/msg00025.html


diff -u -r flac-1.2.1-original\src\libFLAC\bitreader.c 
flac-1.2.1\src\libFLAC\bitreader.c
--- flac-1.2.1-original\src\libFLAC\bitreader.c Tue Sep 11 06:48:56 2007
+++ flac-1.2.1\src\libFLAC\bitreader.c  Tue May 20 12:30:08 2008
@@ -149,15 +149,37 @@
        FLAC__CPUInfo cpu_info;
 };
 
-#ifdef _MSC_VER
-/* OPT: an MSVC built-in would be better */
+
+/* local_swap32_() */
+/* Swaps the byte order of a 32 bits integer, converting between big-endian 
and little-endian */
+#if defined(_MSC_VER)
+
+#include <stdlib.h> // Contains _byteswap_ulong() for MSVC according to MSDN
 static _inline FLAC__uint32 local_swap32_(FLAC__uint32 x)
 {
+       /* This is an intrinsic and will expanded to minimal asm by the 
compiler */
+       return _byteswap_ulong(x);
+}
+
+#else /* defined(_MSC_VER) */
+
+static _inline FLAC__uint32 local_swap32_(FLAC__uint32 x)
+{
+       /* Manual version, a bit slower but works everywhere */
        x = ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF);
        return (x>>16) | (x<<16);
 }
+
+#endif /* defined(_MSC_VER) */
+
+
+/* local_swap32_block_() */
+/* Swaps the byte order of an array of 32 bits integers */
+#if defined(_MSC_VER) && !defined(FLAC__NO_ASM) || !defined(_M_X64)
+
 static void local_swap32_block_(FLAC__uint32 *start, FLAC__uint32 len)
 {
+       /* MSVC specific 32 bit asm version */
        __asm {
                mov edx, start
                mov ecx, len
@@ -173,7 +195,22 @@
 done1:
        }
 }
-#endif
+
+#else /* defined(_MSC_VER) && !defined(FLAC__NO_ASM) || !defined(_M_X64) */
+
+static void local_swap32_block_(FLAC__uint32 *start, FLAC__uint32 len)
+{
+       /* MSVC specific intrinsic version */
+       while(len > 0)
+       {
+               *start = local_swap32_(*start);
+               ++start;
+               --len;
+       }
+}
+
+#endif /* defined(_MSC_VER) && !defined(FLAC__NO_ASM) || !defined(_M_X64) */
+
 
 static FLaC__INLINE void crc16_update_word_(FLAC__BitReader *br, brword word)
 {
_______________________________________________
Flac-dev mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/flac-dev

Reply via email to