[cfe-dev] undefined reference to `operator new(unsigned int)'

Eli Friedman eli.friedman at gmail.com
Fri Apr 8 15:15:56 PDT 2011


On Fri, Apr 8, 2011 at 2:33 PM, Klaus T. <nightos at gmail.com> wrote:
> Hi,
> Recently I started moving from GCC to Clang to compile my own OS. I am using
> Windows and to compile my source files I use "clang++ -ccc-host-triple
> i686-pc-linux" and  link them with i686-elf-ld. However, when I use the "new
> operator" (like int*p = new int; ...) I get "undefined reference to
> `operator new(unsigned int)'" while linking and yes, I use -lstdc++. When I
> compile my source files with GCC I don't have this problem. Any ideas?

Can you attach the .s output from GCC and clang?

-Eli




More information about the cfe-dev mailing list