Extern "C" in C and C++

In reply to rag123:
Thank you rag123,

What I did upon your example was adding include “svdpi.h” in my C code.
But it returns compile error as below.


gcc -w  -pipe -m32 -O -I/apps/vcsmx/vcs/S-2021.09/include    -c ../test.c
../test.c:4:8: error: expected identifier or '(' before string constant
 extern "C" void check();
        ^
make[1]: *** [test.o] Error 1