From: user1 on 30 Sep 2008 23:29 Jinsong.Zhao(a)gmail.com wrote: > Now, I could get all objects correctly, using gfortran -c ... > > Firstly, I compile src_modules, and copy *.mod to src_interfaces, > and then compile src_interfaces. copy *.mod in both directory > to src_subroutines directory, and compile using -c option to get > objects. > > Then move all .o to src_subroutines, and invoke the following > command: > > gfortran -o Mopac *.o > > I get the following error message: > > undefined reference to `__funcon_c__fpc_9' > ... > > I cannot figure out what's wrong. > > Any suggestions, thanks! > > Regards, > Jinsong cd src_modules gfortran -c vastkind.f90 gfortran -c *.f90 copy *.mod ..\Modules ar -r libmodules.a *.o del *.o del *.mod cd ..\src_interfaces gfortran -I..\Modules -c *.f90 copy *.mod ..\Modules ar -r libinterfaces.a *.o del *.o del *.mod cd ..\src_subroutines gfortran -I..\Modules -c *.f90 gfortran *.o ..\src_modules\libmodules.a ..\src_interfaces\libinterfaces.a -o mopac7.exe
From: tsun-1982 on 1 Oct 2008 01:40 I invoke the following command: gfortran *.o ..\src_modules\libmodules.a ..\src_interfaces \libinterfaces.a -o mopac7.exe I get the following error message: getdat.o:getdat.F90:(.text+0xa): undefined reference to `iargc_' getdat.o:getdat.F90:(.text+0x65): undefined reference to `getarg_' collect2: ld returned 1 exit status I cannot figure out what's wrong. Any suggestions, thanks!
From: Jinsong.Zhao on 1 Oct 2008 01:49 On Oct 1, 11:29 am, user1 <u...(a)example.net> wrote: > cd src_modules > gfortran -c vastkind.f90 > gfortran -c *.f90 > copy *.mod ..\Modules > ar -r libmodules.a *.o > del *.o > del *.mod > > cd ..\src_interfaces > gfortran -I..\Modules -c *.f90 > copy *.mod ..\Modules > ar -r libinterfaces.a *.o > del *.o > del *.mod > > cd ..\src_subroutines > gfortran -I..\Modules -c *.f90 > > gfortran *.o ..\src_modules\libmodules.a ..\src_interfaces\libinterfaces.a > -o mopac7.exe Thank you very much, except the last step, it works well. The last step also give error message like analyt.o: In function `analyt_': analyt.F90:(.text+0x2ba): undefined reference to `__funcon_c__a0' analyt.F90:(.text+0x2c8): undefined reference to `__funcon_c__a0' analyt.F90:(.text+0x2ce): undefined reference to `__funcon_c__a0' analyt.F90:(.text+0x1875): undefined reference to `__funcon_c__fpc_9' analyt.o: In function `delri_': analyt.F90:(.text+0x3988): undefined reference to `__funcon_c(...) (void)' analyt.F90:(.text+0x3995): undefined reference to `__funcon_c__a0' analyt.F90:(.text+0x399d): undefined reference to `__funcon_c__a0' If I change the following line in analyt.F90: USE funcon_C, only : a0, fpc_9, ev to USE funcon_C Then the error message disappear, however, I don't know whether it would give error result. Thanks again. Jinsong
From: Richard Maine on 1 Oct 2008 01:51 <tsun-1982(a)163.com> wrote: > getdat.o:getdat.F90:(.text+0xa): undefined reference to `iargc_' > getdat.o:getdat.F90:(.text+0x65): undefined reference to `getarg_' .... > I cannot figure out what's wrong. iargc and getarg are not standard Fortran. I thought gFortran had an option to support them, but I don't recall how to invoke it and I could be wrong about its existence. -- Richard Maine | Good judgement comes from experience; email: last name at domain . net | experience comes from bad judgement. domain: summertriangle | -- Mark Twain
From: Tobias Burnus on 1 Oct 2008 01:56
On 1 Okt., 07:40, tsun-1...(a)163.com wrote: > I get the following error message: > > getdat.o:getdat.F90:(.text+0xa): undefined reference to `iargc_' > getdat.o:getdat.F90:(.text+0x65): undefined reference to `getarg_' > collect2: ld returned 1 exit status > I cannot figure out what's wrong. > > Any suggestions, thanks! I think you will find in the source code somewhere EXTERNAL iargc EXTERNAL getarg External means "A procedure that is defined by an external subprogram or by a means other than Fortran." However, the program assumes that the compiler provides this procedures: "Intrinsic procedures are defined in this standard or provided by a processor". (Quotes: Annex A of the Fortran 2003 standard.) Thus: Replace EXTERNAL by INTRINSIC or comment those lines then it should work. Tobias |