Mail Archives: djgpp/1998/10/20/07:22:19
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 <stdio.h> 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.
- Raw text -