delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2005/06/25/05:01:38

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Problem with make: undefined reference to vtable
Date: 25 Jun 2005 08:47:20 GMT
Lines: 32
Message-ID: <3i4k0oFjns22U1@news.dfncis.de>
References: <1119626620 DOT 773374 DOT 221740 AT g49g2000cwa DOT googlegroups DOT com> <1119627784 DOT 991069 DOT 124850 AT g44g2000cwa DOT googlegroups DOT com> <3i2t6hFjk29aU2 AT news DOT dfncis DOT de> <1119640919 DOT 881671 DOT 6920 AT f14g2000cwb DOT googlegroups DOT com>
X-Trace: news.dfncis.de p8XyU2JStwtMVPo4ynsntAT4Zol6ihF2JoNrcN0ir/GH8OQJeY+lvq0tE3
X-Orig-Path: not-for-mail
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

arizvi <ahmadwaris AT hotmail DOT com> wrote:

> I dont understand how both rules are wrong. Afaik, the top rule states
> that test_view.o depends on test_view.cpp and infoDialog.cpp. So if
> infoDialog.cpp changes, test_view.cpp will be recompiled. 

And that's exactly what's wrong.  That's not how a C or C++ program is
built out of multiple source files.  There should never be a need to
recompile one module file just because the _implementation_ of some
other module changed, but rather only if its _interface_ changed.

> What you are
> suggesting (let me know if I am wrong) is that the rules should be
> simply

> ./test_view.o:: test_view.cpp
> ./infoDialog.o:: infoDialog.cpp,

Not necessarily.  test_view.cpp may depend on the header corresponding
to infoDialog.cpp, commonly called infoDialog.h.  What you've written
so far suggests it probably should.

info_Dialog.o should almost certainly depend on this infoDialog.h, too.

> and then I lose the dependency I am looking for. 

My point is exactly that this dependency must not exist --- you're
looking for the wrong thing.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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