4

I'm trying to test C code with googletest but I'm having some problems when my C header files are included in the C++ test file because the g++ compiler handle them as C++ headers.

I've tried to include these headers inside extern "C" {} with no success.

Is there a way g++ compiler can handle these headers as C ones?

razlebe
  • 7,134
  • 6
  • 42
  • 57
carlosalbertomst
  • 513
  • 6
  • 18

1 Answers1

5

extern "C" only changes link stage name mangling. If you are using C features that aren't shared by C++ then you are SOL

totowtwo
  • 2,101
  • 1
  • 14
  • 21