Mail Archives: djgpp/1996/04/10/20:24:28
Nick Burton wrote:
>
> Ok I have this great program (mikmod) which I can make and
> run fine under GNU C Ver 2.x, when its linked to my code.
>
> But when I try to link it to some of my GNU C++ Ver 2.x
> code make complains at the linking stage that it cant find
> any of the mikmod funcs?
>
> Can anyone help?
>
> P.S. both make files are almost identical, its just the main
> program file is changed from .C to .CC
I had the same problem time ago, with another program and another
C/C++ compiler.
If I remember well, the problem is you should use the following:
/* C++ wrapper */
#ifdef __CPLUSPLUS__
extern "C" {
#endif
/*
* ...Header file contents...
*/
#ifdef __CPLUSPLUS__
}
#endif
/* C++ wrapper */
in every header file.
If I am wrong, will someone please tell me?
I never understood completely the meaning of that ``extern "C"'' I
often find in header files...
All the best
Massimiliano
--
/---------------------------------------------------------\
0 | Massimiliano Mantione [mantione AT mailer DOT cefriel DOT it] | 0
/--+---------------------------------------------------------+--\
| /\ ._. /\ |
| __/ \__ / o \ /` ,__ /` __/ \__ |
| \ \ / / \ `-' /_ ___\ / __ ____, \ \ / / |
| >--()--< ,-. \ / \ / | / / \ / / / >--()--< |
| /__/ \__\ |o' / / / \__/ / \__/ / / / /__/ \__\ |
| \ / `--' ' ` '` ` ` ` \ / |
| \/ ------------------------------------ \/ |
\--+---------------------------------------------------------+--/
0 | CEFRIEL Via Emanueli, 15 (20126 MILANO) [Italy] | 0
\---Tel: +39-2-66100083 (66100750) [Fax: +39-2-66100448]--/
- Raw text -