How gfortran build a .lib fortran file?
dealpro
JimChan00@gmail.com
Sun Dec 14 02:16:00 GMT 2008
thank steve, I do have to build a .lib file cause it is in a complex
directory structure. I have to keep that coz many c/c++ project will use
this .lib
Steve Kargl wrote:
>
> On Sat, Dec 13, 2008 at 05:49:58PM -0800, dealpro wrote:
>>
>> I was using absoft to build datamodel.f in a project to a fortran static
>> library datamodel.lib which would be used by my C++ code. I recently
>> switch
>> to gfortran to compile with a myfile.o is OK but when link the .o to a
>> .lib
>> file showing:
>>
>> gfortran -static -L/Users/DEVELOP/finclude -o "datamodel.lib"
>> ./datarmodel.o
>> collect2: ld returned 1 exit status
>> ld_classic: can't locate file for: -lcrt0.o
>>
>
> If there are no other object files, then you don't need to
> create a library. Simply link in your 8.o file.
>
> gfortran -c datarmodel.f
> g++ your_c++_file.cpp datarmodel.o
>
> --
> Steve
>
>
--
View this message in context: http://www.nabble.com/How-gfortran-build-a-.lib-fortran-file--tp20996516p20996573.html
Sent from the gcc - fortran mailing list archive at Nabble.com.
More information about the Fortran
mailing list