Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #12457

Re: undefined reference to `link'

From Mark Bluemel <mark_bluemel@pobox.com>
Newsgroups comp.lang.c
Subject Re: undefined reference to `link'
Date 2011-11-01 16:21 +0000
Organization A noiseless patient Spider
Message-ID <j8p6gh$989$1@dont-email.me> (permalink)
References <j8p3un$ock$1@dont-email.me> <j8p4g0$rpe$1@dont-email.me> <j8p55i$v4p$1@dont-email.me>

Show all headers | View raw


On 11/01/2011 04:01 PM, Jinsong Zhao wrote:
> On 2011-11-1 23:46, Mark Bluemel wrote:
>> On 11/01/2011 03:41 PM, Jinsong Zhao wrote:
>>> Hi there,
>>>
>>> I tried to compile a c program
>>> (http://people.sc.fsu.edu/~jburkardt/c_src/f77split/f77split.c) using
>>> MinGW/gcc 4.6.1:
>>>
>>> gcc f77split.c
>>>
>>> however, I get the following error message:
>>>
>>> f77split.c:(.text+0x4a9): undefined reference to `link'
>>> collect2: ld returned 1 exit status
>>>
>>> However, compiled the same code with gcc 4.4.x on a Linux machine, and
>>> succeed.
>>>
>>> Does it mean I missing something on my Windows XP with MinGW/gcc 4.6.1?
>>>
>>> Any suggestions will be really appreciated.
>>
>> The code tries to use the link() (and unlink() I think) routines which
>> are part of POSIX, not C. They'll be present on a Linux/Unix system, but
>> probably not on Windows, even wth MinGW.
>
> yes, the code use link and unlink routines.
>
> Is it possible to compile the code on Windows? If yes, how to change the
> code?

You need to work out what the link and unlink routines are being used 
for - I think it's to rename a temporary work file to become an output
file - and then write appropriate code to do that using routines which 
are available on Windows. You probably should ask in a windows forum for 
help with those routines.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

undefined reference to `link' Jinsong Zhao <jszhao@yeah.net> - 2011-11-01 23:41 +0800
  Re: undefined reference to `link' Mark Bluemel <mark_bluemel@pobox.com> - 2011-11-01 15:46 +0000
    Re: undefined reference to `link' Jinsong Zhao <jszhao@yeah.net> - 2011-11-02 00:01 +0800
      Re: undefined reference to `link' Mark Bluemel <mark_bluemel@pobox.com> - 2011-11-01 16:21 +0000
        Re: undefined reference to `link' jgharston <jgh@arcade.demon.co.uk> - 2011-11-02 04:43 -0700
          Re: undefined reference to `link' Keith Thompson <kst-u@mib.org> - 2011-11-02 14:10 -0700
            Re: undefined reference to `link' jgharston <jgh@arcade.demon.co.uk> - 2011-11-03 17:08 -0700
              Re: undefined reference to `link' Keith Thompson <kst-u@mib.org> - 2011-11-03 17:17 -0700
                Re: undefined reference to `link' gordonb.hsqhk@burditt.org (Gordon Burditt) - 2011-11-03 23:11 -0500
          Re: undefined reference to `link' gordonb.d5wxg@burditt.org (Gordon Burditt) - 2011-11-02 16:28 -0500
            Re: undefined reference to `link' Keith Thompson <kst-u@mib.org> - 2011-11-02 15:30 -0700
              Re: undefined reference to `link' gordonb.wk71i@burditt.org (Gordon Burditt) - 2011-11-02 19:33 -0500
                Re: undefined reference to `link' Keith Thompson <kst-u@mib.org> - 2011-11-02 19:24 -0700
      Re: undefined reference to `link' Acid Washed China Blue Jeans <chine.bleu@yahoo.com> - 2011-11-01 10:02 -0700
        Re: undefined reference to `link' gordonb.ztlqg@burditt.org (Gordon Burditt) - 2011-11-02 19:46 -0500
          Re: undefined reference to `link' Seebs <usenet-nospam@seebs.net> - 2011-11-03 18:35 +0000
            Re: undefined reference to `link' Kaz Kylheku <kaz@kylheku.com> - 2011-11-03 19:56 +0000
              Re: undefined reference to `link' Keith Thompson <kst-u@mib.org> - 2011-11-03 14:04 -0700
              Re: undefined reference to `link' Seebs <usenet-nospam@seebs.net> - 2011-11-03 21:45 +0000
              Re: undefined reference to `link' Acid Washed China Blue Jeans <chine.bleu@yahoo.com> - 2011-11-03 15:53 -0700
      Re: undefined reference to `link' Mike Manilone <zhtx10@gmail.com> - 2011-11-02 04:42 +0000
      Re: undefined reference to `link' Geoff <geoff@invalid.invalid> - 2011-11-03 14:52 -0700
        Re: undefined reference to `link' Jinsong Zhao <jszhao@yeah.net> - 2011-11-04 08:19 +0800
          Re: undefined reference to `link' Geoff <geoff@invalid.invalid> - 2011-11-03 21:32 -0700
            Re: undefined reference to `link' Jinsong Zhao <jszhao@yeah.net> - 2011-11-04 13:25 +0800
            Re: undefined reference to `link' Jinsong Zhao <jszhao@yeah.net> - 2011-11-04 13:28 +0800
              Re: undefined reference to `link' Geoff <geoff@invalid.invalid> - 2011-11-03 23:01 -0700
  Re: undefined reference to `link' Kaz Kylheku <kaz@kylheku.com> - 2011-11-03 02:40 +0000

csiph-web