Menu

Setting up F2C with Dev-cpp

2010-05-17
2012-09-26
  • iamactuallyabot

    iamactuallyabot - 2010-05-17

    Does anyone know how to set up the lib f2c (a Fortran to C/C++ converter) to
    work with Dev-Cpp in Windows? In Ubuntu I can simply install the .DEB file and
    link to it during compilation. After converting my Fortran Code, it attaches
    the following to the beginning of the code, it may be helpful in understanding
    what I am talking about:

    /* ising.f -- translated by f2c (version 20050501).
       You must link the resulting object file with libf2c:
        on Microsoft Windows system, link with libf2c.lib;
        on Linux or Unix systems, link with .../path/to/libf2c.a -lm
        or, if you install libf2c.a in a standard place, with -lf2c -lm
        -- in that order, at the end of the command line, as in
            cc *.o -lf2c -lm
        Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
    
            [url]http://www.netlib.org/f2c/libf2c.zip[/url]
    */
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    #include "f2c.h"
    

    Thank you very much for your help!!

     
  • iamactuallyabot

    iamactuallyabot - 2010-05-17

    Note:
    I googled the file libf2c.lib and found a copy from a couple of sources
    including: http://icl.cs.utk.edu/lapack-for-
    windows/clapack/index.html#libraries

    , but Dev-Cpp didn't find them. I tried renaming the libf2c.lib to libf2c.a
    but the following compilation errors occured:

    Compiler: Default compiler
    Building Makefile: "C:\Users\suser\Desktop\tt\Makefile.win"
    Executing  make...
    make.exe -f "C:\Users\suser\Desktop\tt\Makefile.win" all
    g++.exe main.o  -o "Project1.exe" -L"C:/Dev-Cpp/lib" -lf2c -lm
    
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    Warning: .drectve `/manifestdependency:"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'" /DEFAULTLIB:"MSVCRT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/s_stop.obj)(.text[_s_stop]+0xc): undefined reference to `_imp____iob_func'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/sig_die.obj)(.text[_sig_die]+0x7): undefined reference to `_imp____iob_func'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/err.obj)(.text[_f__fatal]+0xf): undefined reference to `_imp____iob_func'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/err.obj)(.text[_f_init]+0x3): undefined reference to `_imp____iob_func'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lwrite.obj)(.text[_lwrt_F]+0x4): undefined reference to `__security_cookie'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lwrite.obj)(.text[_lwrt_F]+0x6b): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lwrite.obj)(.text[_lwrt_C]+0x4): undefined reference to `__security_cookie'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lwrite.obj)(.text[_lwrt_C]+0x114): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lread.obj)(.text[_l_R]+0x4): undefined reference to `__security_cookie'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lread.obj)(.text[_l_R]+0x25): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lread.obj)(.text[_l_R]+0x24d): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lread.obj)(.text[_l_R]+0x2ed): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lread.obj)(.text[_l_R]+0x334): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lread.obj)(.text[_l_R]+0x35e): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lread.obj)(.text[_l_read]+0x174): undefined reference to `_ftol2_sse'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lread.obj)(.text[_l_read]+0x183): undefined reference to `_ftol2_sse'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/lread.obj)(.text[_l_read]+0x193): undefined reference to `_ftol2_sse'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/open.obj)(.text[_f_open]+0x7): undefined reference to `__security_cookie'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/open.obj)(.text[_f_open]+0x250): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/open.obj)(.text[_f_open]+0x48a): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/open.obj)(.text[_f_open]+0x4b4): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/open.obj)(.text[_fk_open]+0x4): undefined reference to `__security_cookie'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/open.obj)(.text[_fk_open]+0xad): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/endfile.obj)(.text[_copy]+0x7): undefined reference to `__security_cookie'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/endfile.obj)(.text[_copy]+0x70): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/endfile.obj)(.text[_copy]+0x8d): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/endfile.obj)(.text[_f_end]+0x4): undefined reference to `__security_cookie'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/endfile.obj)(.text[_f_end]+0x73): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/endfile.obj)(.text[_f_end]+0x98): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/endfile.obj)(.text[_f_end]+0xbd): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/endfile.obj)(.text[_f_end]+0xe0): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/fmt.obj)(.text[_op_gen]+0x21): undefined reference to `_imp____iob_func'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/fmt.obj)(.text[_do_fio]+0x2b5): undefined reference to `_imp____iob_func'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/wrtfmt.obj)(.text[_w_ed]+0x161): undefined reference to `_imp____iob_func'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/wrtfmt.obj)(.text[_w_ned]+0x79): undefined reference to `_imp____iob_func'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/wref.obj)(.text[_wrt_E]+0x4): undefined reference to `__security_cookie'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/wref.obj)(.text[_wrt_E]+0x1a3): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/wref.obj)(.text[_wrt_E]+0x301): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/wref.obj)(.text[_wrt_E]+0x3b6): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/wref.obj)(.text[_wrt_E]+0x402): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/wref.obj)(.text[_wrt_F]+0x7): undefined reference to `__security_cookie'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/wref.obj)(.text[_wrt_F]+0x1a0): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/rdfmt.obj)(.text[_rd_F]+0x4): undefined reference to `__security_cookie'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/rdfmt.obj)(.text[_rd_F]+0xec): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/rdfmt.obj)(.text[_rd_F]+0x14a): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/rdfmt.obj)(.text[_rd_F]+0x1b8): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/rdfmt.obj)(.text[_rd_F]+0x206): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/rdfmt.obj)(.text[_rd_F]+0x355): undefined reference to `@__security_check_cookie@4'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/rdfmt.obj)(.text[_rd_F]+0x3d1): more undefined references to `@__security_check_cookie@4' follow
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/rdfmt.obj)(.text[_rd_ed]+0x16b): undefined reference to `_imp____iob_func'
    C:/Dev-Cpp/lib/libf2c.a(./f2c.dir/Release/rdfmt.obj)(.text[_rd_ned]+0x81): undefined reference to `_imp____iob_func'
    collect2: ld returned 1 exit status
    
    make.exe: *** [Project1.exe] Error 1
    
    Execution terminated
    

    I am using Windows Vista Home Premium because that is what the computer was
    bought with.

     
  • cpns

    cpns - 2010-05-17

    Warning: .drectve `/manifestdependency:"type='win32'
    name='Microsoft.VC90.CRT' version='9.0.21022.8'

    Therein perhaps lies the clue to your problem. MinGW/GCC links to the VC++ 6.0
    C Runtime (CRT), this warning refers to the VC++2010 C runtime. I suggest that
    the easiest solution is probably to use the compiler for which the library was
    intended!

    http://www.microsoft.com/express/downloads/

     
  • huseny

    huseny - 2010-07-30

    Thanks iamactuallyabot , very nice infomation you shared here.

    Marks

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.