Subj : Re: I am using Borland C++4.52 and having a linking issus To : borland.public.cpp.borlandcpp From : James Kim Date : Tue Jul 29 2003 12:23 pm You wrote: What does the code look like where you actually create a test object? --------------------------------------------------------------------------------------------- See the bottom of this message for the code detail.(a little differnt from the code I showed in my first message) I tried "new" and it didn't work either. The exactly same linking error was shown: >>tlink /m /v /s startup.obj Number.obj test.obj, test.exe, test.map >> Error: Undefined symbol operator new(unsigned int) in module TEST.CPP Borland C++4.52 Compiler seems to fail to link whenever I use C++ related utilities such as "constructor" and "new". --------------------------------------------------------------------------------------------- Number.h --------------------------------------------------------------------------------------------- #ifndef _NUMBER_H #define _NUMBER_H class Number { public: Number( ); void PrintValue(int Value ); } --------------------------------------------------------------------------------------------- Number.cpp --------------------------------------------------------------------------------------------- #include "Number.h" void Number::PrintValue(int Value ) { // Do nothing } --------------------------------------------------------------------------------------------- Test.cpp --------------------------------------------------------------------------------------------- #include "Number.h" void main( ) { Number* psMyNumber; psMyNumber = new Number( ); psMyNumber->PrintValue(5); } 1) First of all, the above code would have two linking errors: >>tlink /m /v /s startup.obj Number.obj test.obj, test.exe, test.map >> Error: Undefined symbol operator new(unsigned int) in module NUMBER.CPP This is because I have a constructor. >>tlink /m /v /s startup.obj Number.obj test.obj, test.exe, test.map >> Error: Undefined symbol operator new(unsigned int) in module TEST.CPP This is because I am using "new". 2) If I comment out the constructor in Number.h and not use "new", linking works perfectly with the following main function: void main( ) { Number myNumber; myNumber.PrintValue(5); } Would this have to do with my startup code? or am I missing something in linking? .