Mail Archives: djgpp/1998/04/15/10:48:04
"Jason" <dygron AT ace-net DOT com DOT au> wrote:
> I have written some code in C++ and would like to add prewritten code and
> object files which were written in C. Unfortunately, when the linker gets
> hold of the object files compiled under C to be linked with the object file
> compiled unter C++, I get errors saying that the functions defined in the C
> modules do not exist (but they really do!). Is there a way to link both
> compiler types within the same project or do I have to rewrite them all to
> the same type? (Also, could someone explain what the difference between
> object files produced by a C compiler, and object files produced by a C++
> compiler?). Note: I'm using RHIDE to make projects...could this have
> something to do with it? I'm confused!!!
RHIDE isn't the problem. Just enclose the prototypes of your C code (in the .h
files) with:
#ifdef __cplusplus
extern "C" {
#endif
....
#ifdef __cplusplus
}
#endif
Like all the standard C headers does.
SET
------------------------------------ 0 --------------------------------
Visit my home page: http://set-soft.home.ml.org/
or
http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org
ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -