This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using object compile with gcc with g++


HI Ernst,

If these are your C functions/globals...

double global_River = 3.0;
int global_Dance = 7;

void Foo(void)
{
  // Do something wonderful.
}

double Bar(int a, int b, int c)
{
  // Do something amazing.
}

You should have this in your C++ header file for these C functions/globals...

extern "C" double global_River;
extern "C" int global_Dance;
extern "C" void Foo();
extern "C" double Bar(int a, int b, int c);

HTH,
--Eljay



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]