Mail Archives: djgpp/2000/01/19/10:44:49
To link code compiled in C to your C++ programs,
on the C++ header file use
extern "C" {
// C functions definitions here
// ...
}
It is standard C++.
sam wrote:
> I have been trying too convert some MSC libraries for use with djgpp and
> am encountering some problems.
>
> I have modified my (future) library code and saved it as .CC compiled
> and created library. After several days of fiddling and searching while
> attempting to compile a test.cc I found out that libraries must start
> with lib and specified in RHIDE without the leading LIB and trailing .A
> Ok so now RHIDE is finding it, but still complains about undefined
> reference,.Eventualy I tried it from the command line and only when
> I renamed test.cc to test.c it worked but not in RHIDE.
>
> So who can tell me how to name my functions so that I can write C++ code
> and libraries.
> I have stumbled across the term 'name mangling'???
> What are shared libraries? C & C++?
--
Armando Jorge Sousa | FEUP DEEC
Rua dos Bragas ---_/@\_--- 4099 Porto Codex
Tel: +351-2-2041855 (| ' |) Fax:+351-2-2041632
X----===o====\_/====o===----X
x+x " " x+x
(esta figura deve-se ver com uma fonte nao proporcional)
- Raw text -