Making a new GCC routine visible
Jonathan Wakely
jwakely.gcc@gmail.com
Sat May 19 18:17:00 GMT 2012
On 19 May 2012 19:09, Amittai Aviram wrote:
> Aha! It's declared as
> void * domp_malloc(size_t);
> in a header I #include into my program--but I had forgotten to mark that #include as "extern 'C'." I just tried that and it works!--
>
> extern "C" {
> #include domp_defs.h
> }
>
> So this turned out not to be a GCC issue but just my lack of practice in mixing C and C++ code. Thank you so much for the hint!
Thought so :-)
It's better to make the header self-sufficient:
#ifdef __cplusplus
extern "C" {
#endif
void * domp_malloc(size_t);
#ifdef __cplusplus
extern "C" {
#endif
More information about the Gcc-help
mailing list