Date: Sun, 19 Apr 1998 13:37:01 +0300 (IDT) From: Eli Zaretskii To: Charles Terry cc: djgpp AT delorie DOT com Subject: Re: Unresolved externals In-Reply-To: <353624CC.670E@plinet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Thu, 16 Apr 1998, Charles Terry wrote: > both files compile fine but on the link I get a unresolved external > in func testfunc: int nofunc not found. > > So even though there is no calling thread from main to testfunc, > since nofunc is include in the link in an .o file the linker insists > on resolving it. Of course, it does! Do you expect the linker to perform some kind of flow analysis of the program's code to see whether there's some thread leading to the call? Well, it doesn't do that. All it sees is that somebody, under some circumstances *might* call nofunc. So it insists on resolving it. Btw, if you don't care about this problem, if you *know* that no thread ever gets to that point, you can run the program anyway, and I think it will work just fine. (I didn't actually try this, though.)