Date: Tue, 20 Oct 1998 13:22:14 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: C++ versus C libs In-Reply-To: <362c035a.30503426@news.mci2000.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Tue, 20 Oct 1998, Primro wrote: > This raised all sorts of questions in my mind. Firstly, how can I make > this single routine in assembly language be part of my C++ library? Just like any other object file: "ar rvs libfoo.a bar.o". > secondly, can't I just use any object files made with DJGPP (from > either a cpp or a c file) to make a C++ lib? I seem to get a lot of > "no reference to [some function name]" errors in the linking. You need to declare your assembly function with the ``extern "C"'' qualifier. There are additional ways to avoid the link errors, but this one is the simplest, I think. > If I > include in a C++ file, is this accessing a C lib, or the C++ > lib? Neither. A header file such as stdio.h is accessed by a compiler, not the linker.