This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

undefined reference to `__builtin_new'



I am trying to compile the example to build a relocatable DLL from the  
http://sourceware.cygnus.com/cygwin/building-reloc-dlls.txt.  However, I am
using g++ instead of gcc, and I've converted foo2.c to a C++ class foo2.cc. 
However, the reference to new in foo.c
   foo2 f2 = new foo2();
is not resolvable and produces the following link error.
ld -L 
c:/cygnus/cygwin-b20/H-i586-cygwin32/lib/gcc-lib/i586-cygwin32/egcs-2.91.57
-lgcc -lstdc++ -lgcc --base-file fooB.base --dll -o fooB.dll foo.o foo2.o
init.o fixup.o
c:/cygnus/cygwin-b20/H-i586-cygwin32/i586-cygwin32/lib/libcygwin.a
 -e _dll_entry@12
foo.o(.text+0x25):foo.cc: undefined reference to `__builtin_new'

I've tried moving the call to 'new foo2()' directly to the foo2.cc file,
with no help (I thought maybe you just couldn't call 'new' from a method
declared 'extern C').
A strange note here, foo.o is not even generated from a file called foo.cc
(the file is actually foo.c).  I suppose maybe g++ assumes the source file
to have a .cc extension, I'm not sure.
Any advice greatly appreciated.

Thanks!
-Sonny 





_______________________________________________________
Get 100% FREE Internet Access powered by Excite
Visit http://freelane.excite.com/freeisp


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


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