delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/08/14/15:36:00

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <009701c124f8$09890ab0$2fdd18ac@amr.corp.intel.com>
From: "Tim Prince" <tprince AT computer DOT org>
To: "Astrid Burghard" <Astrid DOT Burghard AT t-online DOT de>, <cygwin AT cygwin DOT com>
References: <15WhV9-0UCd3gC AT fwd03 DOT sul DOT t-online DOT com>
Subject: Re: gcc linking problem - badly installed?
Date: Tue, 14 Aug 2001 12:23:37 -0700
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

----- Original Message -----
From: "Astrid Burghard" <Astrid DOT Burghard AT t-online DOT de>
To: <cygwin AT cygwin DOT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019