> Hello.
>
> I tried to use MinGW to compile a program and link it with libFLAC_static.lib, found at http://sourceforge.net/projects/flac/files/flac-win/flac-1.2.1-win/flac-1.2.1-devel-win.zip/download . Linking failed with the errors
>
>  
>
> c:/[...]/flac/lib/libFLAC_static.lib(./Release_static/stream_decoder.obj):C:\cygwin\home\Adm:(.text[_seek_to_absolute_sample_]+0x529): undefined reference to `_allmul'
> c:/[...]/flac/lib/libFLAC_static.lib(./Release_static/stream_decoder.obj):C:\cygwin\home\Adm:(.text[_seek_to_absolute_sample_]+0x534): undefined reference to `_aulldiv'
> c:/[...]/mingw48_32/bin/../lib/gcc/i686-w64-mingw32/4.8.0/../../../../i686-w64-mingw32/bin/ld.exe: c:/[...]/flac/lib/libFLAC_static.lib(./Release_static/stream_decoder.obj): bad reloc address 0x534 in section `.text[_seek_to_absolute_sample_]'
> collect2.exe: error: ld returned 1 exit status
>
> After investigating a little, I found out that the cause is that libFLAC_static.lib was created with Microsoft Visual Studio, using runtime library Multi-threaded DLL (/MD switch). Some Googling reveals that more static libraries floating around have similar problems, for example MySQL.
>
> Using nm, I found out that the import library msvcrt.lib present in Microsoft Visual Studio does define _allmul and_aulldiv, while libmsvcrt.a present in MinGW does not.
>
> Maybe MinGW's libmsvcrt.a should be updated to solve this incompatibility?
>
> Regards,

Usually, .lib files do not play well with Mingw. There are certain methods you can *try* to get this library to link with your app:

http://www.mingw.org/wiki/MSVC_and_MinGW_DLLs

Please check that page as it has some useful information for you. It involves reimp and dlltool - but results are not guaranteed.

The only sure fire way is to build your library WITH Mingw. 

Hopefully, the library you are trying to link with can easily be ported for Mingw.