-   Programming (
-   -   compiler can't find <new> (

n3wb 05-12-2010 05:41 AM

compiler can't find <new>
My compiler won't find <new>. Since it's such a basic function, I'm a bit confused. Is <new> supposed to be in a file of its own? Where do I find it? And if it turns out to be missing on my computer, where can I find a <new> one? Or do you see anything else that I do wrong?

Edit: After some trying out, it seems I can't find stuff like iostream or any other basic stuff either. The compiler is prolly looking for them at the wrong place. Does anyone know how I change or add paths for the compiler to look in when using the "<>" operator?

mb-linux-g++ -Os -g -fomit-frame-pointer -pipe -fno-common
-fno-builtin -Wall -mno-xl-soft-mul -mcpu=v7.20.d -DEMBED
-Dlinux -D__linux__ -Dunix -DLINUX -c -o upnp.o upnp.cpp
In file included from NptStreams.h:43,
from Neptune.h:49,
from PltTaskManager.h:40,
from PltUPnP.h:40,
from upnp.cpp:37:
NptStrings.h:40:15: error: new: No such file or directory
NptStrings.h: In static member function ‘static NPT_String::Buffer*
NPT_String::Buffer::Allocate(NPT_Size, NPT_Size)’:
NptStrings.h:192: error: no matching function for call to ‘operator
new(long unsigned int, void*&)’
<built-in>:0: note: candidates are: void* operator new(long unsigned int)
upnp.cpp: At global scope:
upnp.cpp:94: warning: ‘bool UpdateState(PLT_DeviceHostReference&)’
defined but not used
make: *** [upnp.o] Error 1

JohnGraham 05-12-2010 06:58 AM

How did you get mb-linux-g++ - I assume from a package installer?

What distribution are you using? If it's any help, on Debian you can just 'apt-get install build-essential'.

orgcandman 05-12-2010 12:11 PM


<built-in>:0: note: candidates are: void* operator new(long unsigned int)
Did you notice this line? Can you post the snippet of your use of new?

All times are GMT -5. The time now is 05:30 PM.