[SRILM User List] Difficulty Building SRILM with mingw-w64

Ryan Zeigler ryan at hlt.utdallas.edu
Mon Jan 16 11:59:31 PST 2012


Hello SRILM mailing list,
I am having difficulty building SRILM 1.6 using the mingw32-w64 
toolchain on a Windows 7 x64 machine.
In order to try and do this, I modified the win32 machine type makefile 
to replace the bare g++/gcc invocations with the target prefixed names 
that are installed by mingw32 and removed the -mno-cygwin line. These 
being the relevant lines.

CC_FLAGS = -DNEED_RAND48 -Wall -Wno-unused-variable -Wno-uninitialized
CC = x86_64-w64-mingw32-gcc $(GCC_FLAGS) -Wimplicit-int
CXX = x86_64-w64-mingw32-g++ $(GCC_FLAGS) -DINSTANTIATE_TEMPLATES

When I subsequently attempt to compile, I receive the following errors 
from matherr.c

x86_64-w64-mingw32-gcc -DNEED_RAND48 -Wall -Wno-unused-variable 
-Wno-uninitialized -Wimplicit-int -I. -I../../include -c -g -O2 
-DUSE_SARRAY -DUSE_SARRAY_TRIE -DUSE_SARRAY_MAP2 -o 
../obj/x86_64-w64-mingw32_c/matherr.o matherr.c
matherr.c:19:16: warning: ‘struct exception’ declared inside parameter list
matherr.c:19:16: warning: its scope is only this definition or 
declaration, which is probably not what you want
matherr.c:19:1: error: conflicting types for ‘_matherr’
/usr/x86_64-w64-mingw32/sys-root/mingw/include/math.h:179:23: note: 
previous declaration of ‘_matherr’ was here
matherr.c: In function ‘_matherr’:
matherr.c:22:10: error: dereferencing pointer to incomplete type
matherr.c:22:36: error: dereferencing pointer to incomplete type
matherr.c:30:1: warning: control reaches end of non-void function
/cygdrive/c/srilm/common/Makefile.common.targets:85: recipe for target 
`../obj/x86_64-w64-mingw32_c/matherr.o' failed


For refrence, the definition of _matherr given is
_CRTIMP int __cdecl _matherr (struct _exception *);

I would appreciate any help in resolving this issue.
Regards,
Ryan Zeigler


More information about the SRILM-User mailing list