🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.asm.x86
Article #150

Re: How to link HelloWorld.O (created by GCC) ??

#150
From: Lukas Reck
Date: Thu, 22 May 2003 18:32
23 lines
2654 bytes
"Hans" <nospam@nospam.com> schrieb:

>But how to link HelloWorld.O to HelloWorld Executable? Which minimal command
>line options do I need to use to link? The Linker is complaining about the
>Printf call. Against which and HOW sharedlibrary stub do I need to link
>HelloWorld.O?
you'll probably need the following:
ld -o HelloWorld HelloWorld.o -lc <kinda libgcc.a somewhere> \
/usr/lib/crt0.a <some more stuff... YMMV>

if you want to know it exactly, do gcc -v HelloWorld.c, this will have
the above `ld� command line somewhere in the output.

Alternatively, try 
gcc -o HelloWorld HelloWorld.o
or
gcc -o HelloWorld HelloWorld.s

gcc is smart enough to deal with .s files (it assembles them) as well
as .o files (which it will link into the final executable). _And_ it
will link in the appropriate libs.

Lukas Reck
Technical Details
Message-ID: <9d5qcvcu1318vh7ku3vls78c6geak6k1tj@4ax.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!news.crayne.org!clax86!robomod!not-for-mail
References: <bagdiq$ol1$1@news4.tilbu1.nb.home.nl>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 114917,3e6e7567159c8b7a
X-Google-Attributes: gid114917,public
X-Google-Thread: f65d0,3e6e7567159c8b7a
X-Google-Attributes: gidf65d0,public
X-Google-ArrivalTime: 2003-05-22 12:57:43 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!news.crayne.org!clax86!robomod!not-for-mail
From: Lukas Reck <Lukas_BW@gmx.de>
Newsgroups: comp.lang.asm.x86,gnu.gcc
Subject: Re: How to link HelloWorld.O (created by GCC) ??
Approved: CLAX86 Moderators <ccrayne@crayne.org>
Date: Thu, 22 May 2003 20:32:03 +0200
Organization: Posted via Supernews, http://www.supernews.com
Message-ID: <9d5qcvcu1318vh7ku3vls78c6geak6k1tj@4ax.com>
X-CLAX86-Policy: http://www.pacificsites.com/~ccrayne/clax86.html
X-CLAX86-Faq: http://www2.dgsys.com/~raymoon/x86faqs.html
X-CLAX86-Info-1: Send submissions to             comp-lang-asm-x86@moderators.isc.org
X-CLAX86-Info-2: Send technical complaints to    ccrayne@crayne.org
X-CLAX86-Info-3: Send complaints about policy to ccrayne@crayne.org
X-Comment: moderators do not necessarily agree or disagree with this article.
References: <bagdiq$ol1$1@news4.tilbu1.nb.home.nl>
Reply-To: Lukas_BW@gmx.de
X-Orig-NNTP-Posting-Host: dialin-212-144-129-219.arcor-ip.net (212.144.129.219)
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Orig-X-Trace: fu-berlin.de 1053628189 381531 212.144.129.219 (16 [195527])
X-Newsreader: Forte Free Agent 1.93/32.576 Deutsch (Standard)
X-MailScanner: Found to be clean
X-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=0.3,
 required 5, REFERENCES, SPAM_PHRASE_00_01)
X-UIDL: K2X"!=4W!!g/a"!Fm%"!
X-Complaints-To: abuse@supernews.com
Lines: 24