8.3.2. Including your own C header files

To include your own C header files, you must wrap the #include directive in an extern "C" statement. You can do this in two ways:

Example 8.7. 

// C++ code
extern "C"{
#include "my-header1.h"
#include "my-header2.h"
}
int main()
{
	// ...
	return 0;
}

Example 8.8. 

/* C header file */
#ifdef __cplusplus						/* Insert start of extern C construct */
extern "C" {
#endif
/* Body of header file */
#ifdef __cplusplus						/* Insert end of extern C construct */
}						/* The C header file can now be */
#endif						/* included in either C or C++ code. */
Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D
Non-Confidential