$ cat getlog.f character*50 user call getlog(user) write(*,"(A)") user end $ gfortran getlog.f cc4Qbaaa.o:getlog.f:(.text+0x15): undefined reference to `_gfortran_getlog' collect2: ld returned 1 exit status mingw sets the USERNAME environment variable, we should use it to provide a getlog procedure. Or we could use a windows API function (if there is one available on all windows versions).
(In reply to comment #0) > mingw sets the USERNAME environment variable, we should use it to provide a > getlog procedure. NT and later set USERNAME by default. win95, win98 do not. The var may not necessarily refect the logon name. > Or we could use a windows API function (if there is one > available on all windows versions). GetUserName()
Subject: Bug 23803 CVSROOT: /cvs/gcc Module name: gcc Changes by: fxcoudert@gcc.gnu.org 2005-09-25 21:02:17 Modified files: libgfortran : ChangeLog libgfortran/intrinsics: getXid.c getlog.c hostnm.c Log message: PR libfortran/23803 * intrinsics/getXid.c: Add getpid wrapper for MinGW. * intrinsics/getlog.c: Add getlogin wrapper for MinGW. * intrinsics/hostnm.c: Add gethostname wrapper for MinGW. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.306&r2=1.307 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/getXid.c.diff?cvsroot=gcc&r1=1.4&r2=1.5 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/getlog.c.diff?cvsroot=gcc&r1=1.3&r2=1.4 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/hostnm.c.diff?cvsroot=gcc&r1=1.2&r2=1.3
Subject: Bug 23803 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: fxcoudert@gcc.gnu.org 2005-09-29 12:28:52 Modified files: libgfortran : ChangeLog libgfortran/intrinsics: cpu_time.c getXid.c getlog.c hostnm.c sleep.c Log message: Backport from mainline: PR libfortran/23380 PR libfortran/23802 PR libfortran/23803 * intrinsics/getXid.c: Add getpid wrapper for MinGW. * intrinsics/getlog.c: Add getlogin wrapper for MinGW. * intrinsics/hostnm.c: Add gethostname wrapper for MinGW. * intrinsics/sleep.c: Add correct sleep macro for MinGW. * intrinsics/cpu_time.c (__cpu_time_1): Provide a MS Windows version. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.163.2.92&r2=1.163.2.93 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/cpu_time.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5&r2=1.5.12.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/getXid.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3&r2=1.3.12.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/getlog.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1.2.2&r2=1.1.2.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/hostnm.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1.2.1&r2=1.1.2.2 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/intrinsics/sleep.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1.2.1&r2=1.1.2.2
Fixed.