Problem installing mingw version of gfortran

Brian Dessent brian@dessent.net
Fri Sep 19 12:34:00 GMT 2008


Peter Broer wrote:

> ../../../trunk/libgfortran/io/list_read.c:2539: undefined reference to
> `__mingw_snprintf'

I can't reproduce this problem.  It works fine here:

c:\tmp>gfortran -v
Using built-in specs.
Target: i586-pc-mingw32
Configured with: ../trunk/configure --prefix=/mingw
--enable-languages=c,fortran --with-gmp=/home/FX/local
--with-ld=/mingw/bin/ld --with-as=/mingw/bin/as --disable-werror
--enable-bootstrap --enable-threads --disable-nls
--build=i586-pc-mingw32 --enable-libgomp --disable-shared
Thread model: win32
gcc version 4.4.0 20080603 (experimental) [trunk revision 136333] (GCC)

C:\tmp>gfortran matmul.for

C:\tmp>a
  1  2  2
  3  3  4
 15 21

The symbol __mingw_snprintf is provided by libmingwex.a, which should be
at lib/mingwex.a under your install directory.  I suspect that somehow
you have an older version of this library (before this symbol was added)
somewhere floating around in the search path and it's being found and
used.  If it wasn't finding libmingwex.a at all you'd get a lot more
errors, so since it's just this one symbol which is a relatively recent
addition to the library, that is why I suspect an older version is
somewhere.  You might want to try:

c:\tmp>gfortran -Wl,--verbose matmul.for | grep "libmingwex.a succeeded"
attempt to open
c:/tmp/gfortran/bin/../lib/gcc/i586-pc-mingw32/4.4.0/../../../libmingwex.a
succeeded
attempt to open
c:/tmp/gfortran/bin/../lib/gcc/i586-pc-mingw32/4.4.0/../../../libmingwex.a
succeeded

Figure out which version of libmingwex is being used and you should be
able to track down your problem.  You might also want to investigate
your environment, for example if you have LIBRARY_PATH pointing to some
other tool's installation it will cause it to search for -lmingwex from
there.

Brian



More information about the Fortran mailing list