delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/06/05:54:37

Date: Mon, 6 Mar 2000 09:41:15 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: caramaith <caramaith AT myokay DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: odd compiler error in DJGPP...
In-Reply-To: <38C307A8.6F680858@myokay.net>
Message-ID: <Pine.SUN.3.91.1000306094051.9921G-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 6 Mar 2000, caramaith wrote:

> I get this when just doing the normal
> 
> gcc -o CppLibTest.exe CppLibTest.cpp

This is wrong.  Try this:

  gcc -o CppLibTest.exe CppLibTest.cpp CppLib.o

You *must* submit all the relevant source/object files to GCC,
otherwise how do you expect the linker to find code you put into
CppLib.cpp?

> He said I had to state every source file... even the
> CppLib.cpp (which is the object-file to CppLib.h, the header-file
> naturally enclosed in CppLibTest.cpp).

The header files doesn't include anything except the text that you see
inside that header file.  It does NOT magically pull in the code of
CppLib.cpp, because that's a different file.

> Is this really the case??? 

Yes, that's the case.

- Raw text -


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