Linking C++ Functions in C

Alexandre Oliva aoliva@redhat.com
Tue Sep 4 19:25:00 GMT 2001


On Aug 27, 2001, Vishal Chanchalani <gccmailinglistid@yahoo.com> wrote:

> This works fine, and links to teh c program till i do
> not use "new" in the c++ functions. The moment i use
> it, the linker gives an error for new and delete. 

> Is there any workaround for this ?

Link using g++ or explicitly link in -lstdc++, where the
implementations of new and delete are.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Gcc-help mailing list