www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/10/20:24:28

Xref: news2.mv.net comp.os.msdos.djgpp:2590
From: Massimiliano Mantione <mantione AT mailer DOT cefriel DOT it>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: MikMod210
Date: Wed, 10 Apr 1996 15:11:48 +0200
Organization: Computer Science Dep. - Milan University
Lines: 58
Message-ID: <316BB394.651A@mailer.cefriel.it>
References: <199604090947 DOT FAA22372 AT delorie DOT com>
NNTP-Posting-Host: puccini.cefriel.it
Mime-Version: 1.0
To: Nick Burton <nmr AT doc DOT ntu DOT ac DOT uk>
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019