开发者

Testing C code with googletest (Google C++ Testing Framework)

开发者 https://www.devze.com 2023-03-20 22:57 出处:网络
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'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 th开发者_如何学编程ese headers as C ones?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消