Problem building C program with MinGW

Open discussion regarding features, bugs, issues, vendors, etc.

Problem building C program with MinGW

Postby ColdHorizon » Mon May 16, 2011 8:03 pm

Hi,

I need some advice regarding a C program I am trying to build with MinGW on a Windows XP system. The program is an f2c'd version of a Fortran program which factorises a complex polynomial (see http://www.netlib.org/toms/419 for details). I am attempting to build the program as follows:

C:\MinGW>gcc -c algorithm419.c
C:\MinGW>gcc algorithm419.o libf2c.lib

I then get the following messages on screen:

Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized
libf2c.lib(./release without wrap/open1.obj):(.text[_f_open]+0x7): undefined reference to `__security_cookie'
libf2c.lib(./release without wrap/open1.obj):(.text[_f_open]+0x252): undefined reference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/open1.obj):(.text[_f_open]+0x46a): undefined reference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/open1.obj):(.text[_f_open]+0x496): undefined reference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/open1.obj):(.text[_fk_open]+0x4): undefined reference to `__security_cookie'
libf2c.lib(./release without wrap/open1.obj):(.text[_fk_open]+0xa0): undefined reference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/endfile1.obj):(.text[_copy]+0x7): undefined reference to `__security_cookie'
libf2c.lib(./release without wrap/endfile1.obj):(.text[_copy]+0x6e): undefined reference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/endfile1.obj):(.text[_copy]+0x8b): undefined reference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/endfile1.obj):(.text[_f_end]+0x4): undefined reference to `__security_cookie'
libf2c.lib(./release without wrap/endfile1.obj):(.text[_f_end]+0x6c): undefinedreference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/endfile1.obj):(.text[_f_end]+0x91): undefinedreference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/endfile1.obj):(.text[_f_end]+0xb5): undefinedreference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/endfile1.obj):(.text[_f_end]+0xd8): undefinedreference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/wref1.obj):(.text[_wrt_E]+0x4): undefined reference to `__security_cookie'
libf2c.lib(./release without wrap/wref1.obj):(.text[_wrt_E]+0x197): undefined reference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/wref1.obj):(.text[_wrt_E]+0x303): undefined reference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/wref1.obj):(.text[_wrt_E]+0x3ce): undefined reference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/wref1.obj):(.text[_wrt_E]+0x424): undefined reference to `@__security_check_cookie@4'
libf2c.lib(./release without wrap/wref1.obj):(.text[_wrt_F]+0x7): undefined reference to `__security_cookie'
libf2c.lib(./release without wrap/wref1.obj):(.text[_wrt_F]+0x1b0): undefined reference to `@__security_check_cookie@4'
collect2: ld returned 1 exit status

Can anyone tell me what the problem might be? I realise this is not strictly a LAPACK/CLAPACK question, however I get the same error message when trying to build programs that call the CLAPACK library. Therefore I think my question has some relevance!

Thanks,
Brendan.
ColdHorizon
 
Posts: 1
Joined: Mon May 16, 2011 7:31 pm

Re: Problem building C program with MinGW

Postby admin » Wed May 18, 2011 10:05 am

HI,
You should try to build the libf2c lib from CLAPACK using CMAKE build for MinGW.
See steps here: http://icl.cs.utk.edu/lapack-for-window ... html#build (of course you need to pick MinGW instead of VS Solution)
I am not familiar with those kind of undefined reference.
Julie
admin
Site Admin
 
Posts: 501
Joined: Wed Dec 08, 2004 7:07 pm

Re: Problem building C program with MinGW

Postby CyLith » Wed May 18, 2011 6:56 pm

Those errors are because the f2c lib was built with visual studio. See http://support.microsoft.com/kb/894573 for details. You can try making gcc link with the bufferoverflow*.lib to see if that fixes things, but I doubt it. The proper thing to do is to compile everything, including f2c, with the MinGW toolchain, as Julie suggested.
CyLith
 
Posts: 37
Joined: Sun Feb 08, 2009 7:23 am
Location: Stanford, CA

Re: Problem building C program with MinGW

Postby donaldsmith » Sat Jul 30, 2011 4:20 am

You may change your MinGW Account Options or unsubscribe and try again to login back in to your account. If the problem exists then change your account. Also paste database information into your new account.
donaldsmith
 
Posts: 3
Joined: Fri Jul 22, 2011 4:18 am


Return to User Discussion

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 3 guests