http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47260
Summary: DLLEXPORT attribute requires additional capabilities to be useful Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: craig.pow...@gmail.com With the following mingw gfortran package: Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=c:/program files/gfortran/bin/../libexec/gcc/i586-pc-mingw32 /4.6.0/lto-wrapper.exe Target: i586-pc-mingw32 Configured with: ../gcc-trunk/configure --prefix=/mingw --enable-languages=c,for tran --with-gmp=/home/brad/gfortran/dependencies --disable-werror --enable-threa ds --disable-nls --build=i586-pc-mingw32 --enable-libgomp --disable-shared --dis able-win32-registry --with-dwarf2 --disable-sjlj-exceptions --enable-lto Thread model: win32 gcc version 4.6.0 20101201 (experimental) [trunk revision 167359] (GCC) If I build a standalone function declared as: INTEGER FUNCTION test() !GCC$ ATTRIBUTES STDCALL, DLLEXPORT :: test test = 1 END FUNCTION test and build it with: gfortran -std=f2008 -march=native -c bug.f90 The result is: bug.f90:1:0: error: external linkage required for symbol 'test' because of 'dlle xport' attribute I believe that either something is not being set correctly for symbol 'test', or an additional attribute needs to be made available so that 'test' can be marked correctly. In the absence of this, the manual should clearly state that dllexport cannot be applied to procedures in Windows.