Multiple definitions of '_gfortran_[...]' in Windows

Post here if you have a question about the installation process

Multiple definitions of '_gfortran_[...]' in Windows

Postby adamalb » Mon Jul 23, 2018 3:54 pm

I am trying to install LAPACK for Windows using MinGW following the instructions in 'Easy Windows Build' -
Ultimately I just want to be able to link LAPACk libraries to compilation in gfortran out of Visual Studio and without Intel compilers.
I consistently get this error when running 'make' from MinGW:

[ 44%] Linking Fortran shared library ..\bin\liblapack.dll
C:/mingw-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/libgfortran.a(string_intrinsics.o):(.text$__gfortran_concat_string+0x0): multiple definition of `_gfortran_concat_string'
../lib/libblas.dll.a(d000008.o):(.text+0x0): first defined here
C:/mingw-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/libgfortran.a(string_intrinsics.o):(.text$__gfortran_string_len_trim+0x0): multiple definition of `_gfortran_string_len_trim'
../lib/libblas.dll.a(d000038.o):(.text+0x0): first defined here
C:/mingw-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/libgfortran.a(transfer.o):(.text$__gfortran_transfer_integer_write+0x0): multiple definition of `_gfortran_transfer_integer_write'
../lib/libblas.dll.a(d000058.o):(.text+0x0): first defined here
C:/mingw-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/libgfortran.a(transfer.o):(.text$__gfortran_transfer_character_write+0x0): multiple definition of `_gfortran_transfer_character_write'
../lib/libblas.dll.a(d000053.o):(.text+0x0): first defined here
C:/mingw-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/libgfortran.a(transfer.o):(.text$__gfortran_st_write+0x0): multiple definition of `_gfortran_st_write'
../lib/libblas.dll.a(d000032.o):(.text+0x0): first defined here
C:/mingw-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/libgfortran.a(transfer.o):(.text$__gfortran_st_write_done+0x0): multiple definition of `_gfortran_st_write_done'
../lib/libblas.dll.a(d000033.o):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
mingw32-make[2]: *** [SRC\CMakeFiles\lapack.dir\build.make:27686: bin/liblapack.dll] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:163: SRC/CMakeFiles/lapack.dir/all] Error 2
mingw32-make: *** [Makefile:162: all] Error 2

I am using the latest version of MinGW (.txt in folder says 'version : MinGW-W64-builds-4.3.5'), CMake 3.12.0 and LAPACK 3.8.0, although I have tried other LAPACK and MinGW versions with similar errors.
Switching between native compilers of 32 and 64 bits in CMake does not affect, I still get the same error.
I am building the files with CMake checking LAPACKE. Not checking its box gives the same error, but at stage [100%].
I am using Windows 10 Education.

What kind of error is this? Can I solve it myself? Is there any combination of program version that solve this issue?
Posts: 1
Joined: Fri Jul 20, 2018 9:32 pm

Re: Multiple definitions of '_gfortran_[...]' in Windows

Postby poetlyu » Tue Jul 24, 2018 3:59 am

I've encountered completely the same problem as yours. I also tried different versions of Mingw or Lapack, it didn't work.
Posts: 1
Joined: Tue Jul 24, 2018 1:14 am

Re: Multiple definitions of '_gfortran_[...]' in Windows

Postby admin » Tue Jul 24, 2018 11:34 am

Did you try adding -lgfortran in your linking sequence?
Site Admin
Posts: 614
Joined: Wed Dec 08, 2004 7:07 pm

Return to Installation

Who is online

Users browsing this forum: No registered users and 2 guests