You need to wrap the C code like so
extern "C" { #include "sample1.h" } See Including C Code in C++ for an example and Combining C++ and C - how does #ifdef __cplusplus work? for details
You need to wrap the C code like so
extern "C" { #include "sample1.h" } See Including C Code in C++ for an example and Combining C++ and C - how does #ifdef __cplusplus work? for details