> Thank you very much for your help
> 
> I did like this ..
> extern "C"
> {
>  #include "com.h"
> }


Hmm, that can work, but is not recommended.

The preferred solution is to put conditional guards into the "com.h"
file itself, if you are mixing C and C++ sources together, like this...

Near the top of your file, before any extern functions or variables are
listed, add:

/* Allow C++ Portability */
#ifdef __cplusplus
extern "C" {
#endif


Then at the bottom of your file, add the matching:


/* Allow C++ Portability */
#ifdef __cplusplus
}
#endif

This means that if the header is included by any C++ file, it sees the C
linkage directive, but the added bits are not seen at all by the plain C
code.
(NOTE: All C++ compilers by definition are required to define the
__cplusplus item.)


If you can not modify the "com.h" file for some reason, then make a new
header, say "com_wrapper.h" that simply says...

extern "C" 
{  
#  include "com.h" 
}


Then use the "com_wrapper.h" file in your C++ sources...



SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 
3EL
A company registered in England & Wales.  Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to