🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #9984

Re: gcc probleemke

#9984
From: Bart Vandewoestyne
Date: Tue, 02 Apr 2002 08:23
51 lines
2606 bytes
Bart.Vanhauwaert@nowhere.be wrote:
> 
> Je moet ook nog algorithms.c compileren en dan meelinken. De volledige
> volgorde van compileren is (untested)
> 
> gcc -Wall -c algorithms.c -o algorithms.o
> gcc -Wall -c main.c -o main.o
> gcc  algorithms.o main.o -o programma
> 
> Je steekt dat alles natuurlijk het best in een Makefile (untested)
> 
> algorithms.o: algorithms.h algorithms.c
> main.o: algorithms.h main.c
> 
> programma: main.o algorithms.o
>         gcc algorithms.o main.o -o programma
> 
> (De white space op de laatste regel _moet_ een tab zijn)

Yeps, maar was intussen al opgelost in deze thread ;-)

> PS. Je algorithms.c file is onduidelijk omdat je perse met zo'n
> result unsigned int wil bijhouden. Schrijf liever
> 
> unsigned int gcd(unsigned int a, unsigned int b)
> {
>         if (b == 0)
>                 return a;
>         else
>                 return gcd(b,a%b);
> }
> 
> of nog korter
> 
> unsigned int gcd(unsigned int a, unsigned int b)
> {
>         return b==0 ? a : gcd(b,a%b);
> }

Yep, dat had ik intussen zelf ook al gemerkt en was hier lokaal al
veranderd... sorry voor de slechte stlijl... ;-)

Greetzzz,
mc303

-- 
Ing. Bart Vandewoestyne			 Bart.Vandewoestyne@pandora.be
Hugo Verrieststraat 48			       GSM: +32 (0)478 397 697
B-8550 Zwevegem			 http://users.pandora.be/vandewoestyne
----------------------------------------------------------------------
"Any fool can know, the point is to understand." - Albert Einstein
Technical Details
Message-ID: <3CA96A63.7246C44E@pandora.be>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!iad-peer.news.verio.net!news.verio.net!skynet.be!skynet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
References: <3CA743FA.F9B401AB@pandora.be> <kk898a.glg.ln@ns1.irule.be>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: fcea4,445f663aa5c7931a
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2002-04-02 00:23:17 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!iad-peer.news.verio.net!news.verio.net!skynet.be!skynet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail
Message-ID: <3CA96A63.7246C44E@pandora.be>
From: Bart Vandewoestyne <Bart.Vandewoestyne@pandora.be>
Organization: MyHome
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.17 i686)
X-Accept-Language: nl-BE, nl, en, de
MIME-Version: 1.0
Newsgroups: be.comp.programming
Subject: Re: gcc probleemke
References: <3CA743FA.F9B401AB@pandora.be> <kk898a.glg.ln@ns1.irule.be>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 51
Date: Tue, 02 Apr 2002 08:23:06 GMT
NNTP-Posting-Host: 213.118.85.250
X-Complaints-To: abuse@telenet.be
X-Trace: afrodite.telenet-ops.be 1017735786 213.118.85.250 (Tue, 02 Apr 2002 10:23:06 MET DST)
NNTP-Posting-Date: Tue, 02 Apr 2002 10:23:06 MET DST