title: mixing C & C++ code in static library
body: <p>I'm trying to create a static library that contains C and C++ functions and then use this library in a C environment. As per <a href="https://stackoverflow.com/questions/199418/using-c-library-in-c-code/199422#199422">Using C++ library in C code</a>, I wrap C functions around C++ functions.</p>
  
  <p>The makefile for the library uses "ar -rvs libNAMEX.a $(OBJECTS)" where OBJECTS contains the object files compiled by gcc or g++ depending on type (GCC version 4.4.1).</p>
  
  <p>I don't encounter any errors when building the library. But when I try to compile a C file (with a cross-compiled version of GCC 4.5.1) that used the library: "gcc -L[PATH TO libNAMEX.a] -lNAMEX ... c_source.c", it gives me errors related to C++ extensions (i.e., "undefined reference to <code>operator new(unsigned long)", "undefined reference to</code>std::allocator::~allocator()'").</p>
  
  <p>Are there any way around this problem?</p>