Hi,

I am trying to compile a FORTRAN program to call from R under Windows 7 but
I am having problem in the compiling step. To demonstrate this is the
program testit.f:

------------------------------------------
      subroutine TESTIT(x,n,m)
      dimension x(n)
      do 10 i=1,n
10      x(i)=x(i)**m
      end
--------------------------------------------

When I compile it with gfortran I get the following error:

--------------------------------------------------
c:\MinGW\programs>gfortran testit.f -o testit.o
c:/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../libmingw32.a(main.o):main.c:(.tex
t+0xd2): undefined reference to `WinMain@16'
collect2: ld returned 1 exit status.
----------------------------------------------------

I should add that a program like the following hello.f compiles with no
problem.

------------------------------------------
         READ (*, *) YOURNAME
         WRITE (*, 200) YOURNAME
 200     FORMAT(//,' Hello ',A/)
         STOP
         END
------------------------------------------

I realize that this is not directly a question about R but I guess there are
some people here who have compiled FORTRAN programs under Windows 7 to call
from R. I appreciate any help to fix the problem.

/Mikael

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to