Incuding C++ header files in C, VS 2010
I want to write a C code, say "test.c" call some C++ functions from it.I have a header file header.h which has function defined in it and a C++ file which has definitions of functions.I'm unable to figure out compilation commands and how to use extern command. Can someone clarify this?
Thanks in advance,
Neerad
I've compiled but there is a problem
Quote:
Originally Posted by
neeraddevil
Hey, thanks. I have gone through that already but I couldn't find any instructions for compiling the code
insert
Code:
#ifdef __cplusplus
extern "C"
{
#endif
void foo (void);
#ifdef __cplusplus
};
#endif
Then I implement foo() in .cpp file. I also include .h in .cpp
and it worked. But the problem is I can't define any classes in header file after I do this. If the classes are in .cpp file, it works