public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Tim Prince" <tprince@computer.org>
To: "Astrid Burghard" <Astrid.Burghard@t-online.de>, <cygwin@cygwin.com>
Subject: Re: gcc linking problem - badly installed?
Date: Tue, 14 Aug 2001 12:33:00 -0000	[thread overview]
Message-ID: <009701c124f8$09890ab0$2fdd18ac@amr.corp.intel.com> (raw)
In-Reply-To: <15WhV9-0UCd3gC@fwd03.sul.t-online.com>

----- Original Message -----
From: "Astrid Burghard" <Astrid.Burghard@t-online.de>
To: <cygwin@cygwin.com>
Sent: Tuesday, August 14, 2001 9:57 AM
Subject: gcc linking problem - badly installed?


> Hi,
>
> I am new to this list, so please excuse me and
> give me a hint if this topic was treated here
> before.
>
> I tried some simple C and F77 "hello world"
> programmes to get compiled and linked by "gcc"
> and "gcc -c" + "ld".  The .o was created by
> "gcc -c" without error message, but both direct
> executable creation with "gcc" and linking the
> .o by "ld" failed, giving different error
> messages.  The .log I appenden at the bottom of
> the email.  Does anyone have an idea what is
> going wrong?
>
> Thanks in advance
>
> Enno.
>
> ------------------ start of
log ----------------------------------------
> + cat test_c.c
> /*---------------- test_c.c ----------
start -------------------------*/
> #include <stdio.h>
> main()
>   {
> printf( "%s\n", "Hello world!" );
>   }
> /*---------------- test_c.c ----------
end ---------------------------*/
> + gcc test_c.o
> /PROGS/CYGWIN/USR/BIN/ld: cannot open crt0.o: No such file or
directory
> collect2: ld returned 1 exit status
> + gcc -c test_c.c
> + ld test_c.o
> ld: warning: cannot find entry symbol _mainCRTStartup;
defaulting to 00401000
> test_c.o(.text+0x1b):test_c.c: undefined reference to `__main'
> test_c.o(.text+0x2d):test_c.c: undefined reference to `printf'
> + cat test_f.f
> *----------------- test_f.f ----------
start ---------------------------
>       program testf
>   print*, 'Hello world!'
>   end
> *----------------- test_f.f ----------
end -----------------------------
> + gcc test_f.o
> /PROGS/CYGWIN/USR/BIN/ld: cannot open crt0.o: No such file or
directory
> collect2: ld returned 1 exit status
> + gcc -c test_f.f
> + ld test_f.o
> ld: warning: cannot find entry symbol _mainCRTStartup;
defaulting to 00401000
> test_f.o(.text+0x23):test_f.f: undefined reference to `s_wsle'
> test_f.o(.text+0x3c):test_f.f: undefined reference to `do_lio'
> test_f.o(.text+0x44):test_f.f: undefined reference to `e_wsle'
> test_f.o(.text+0x53):test_f.f: undefined reference to `s_stop'
>
The gcc and g77 commands invoke the correct link and library
specifications, if properly installed.  There is no way that the
ld command by itself will know what to do. crt0.o appears in /lib
in my installation.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

  parent reply	other threads:[~2001-08-14 12:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-14  9:57 Astrid Burghard
2001-08-14 10:23 ` Larry Hall (RFK Partners, Inc)
2001-08-14 12:33 ` Tim Prince [this message]
2001-08-19  2:14   ` Astrid Burghard
2001-08-19 13:42     ` Christopher Faylor
2001-08-16  6:32 Eric Moyer
2001-08-16  6:40 ` Christopher Faylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='009701c124f8$09890ab0$2fdd18ac@amr.corp.intel.com' \
    --to=tprince@computer.org \
    --cc=Astrid.Burghard@t-online.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).