Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2000 08:35:26 -0800 (PST)
From:      Steve Kargl <sgk@troutmask.apl.washington.edu>
To:        Andrew Otwell <aotwell@iss.net>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: porting Linux application to FreeBSD
Message-ID:  <200011271635.eARGZQw29552@troutmask.apl.washington.edu>
In-Reply-To: <3A228681.4A3DBE88@iss.net> from Andrew Otwell at "Nov 27, 2000 11:06:25 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Andrew Otwell wrote:
> 
> A couple of you answered my first query which gave me....
> 
> gcc -nostdinc -I/includedir -nostdlib -L/libdir source.c
> 
> This always failed with either....
> 
> ld: No reference to __DYNAMIC
> collect2: ld returned 1 exit status
> 

info gcc

gcc -v -static -nostdinc -I/includedir -nostdlib source.c \
    -L/libdir -lfirstlib -lsecondlib .... -lc

The -v flag will show you all aspects of the linking of
your program.  The -static flags make gcc use static linking.
The -nostdlib suppress the normal linking of libraries 
usually supplied by the system.  This means you have to 
explicitly list all libraries on the command including the
standard C library.

-- 
Steve


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200011271635.eARGZQw29552>