🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #41726

Linking

#41726
From: Dinkar N Bhat
Date: Tue, 20 Feb 1996 00:00
13 lines
897 bytes
Can someone help me with this? I have a function f(..) called in main(),
and it resides in file g.c, also in libtest.a

When I specify gcc main.c g.o -ltest, I want it to pickm the definition
of f(..) from g.c, instead of libtest.a. When I just say 
gcc main.c -ltest, I would like the defintion from libtest.a

I keep getting errors saying "multiply defined function name". It used
to work with cc, and also I heard it works with gcc. Do I have to
specify some other option for linking?

Thanks
Dinkar.
Technical Details
Message-ID: <4gdsao$jl4@saxophone.cs.columbia.edu>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,99152aad5fee1734,start
X-Google-Attributes: gid11318c,public
From: bhat@news.cs.columbia.edu (Dinkar N Bhat)
Subject: Linking
Date: 1996/02/20
Message-ID: <4gdsao$jl4@saxophone.cs.columbia.edu>
X-Deja-AN: 140346574
organization: Columbia University Department of Computer Science
newsgroups: gnu.gcc.help