I'm having a weird error. I'm trying to use the Map library, and doing so is breaking my code.
I define my map thusly:
map<int, int> myMap;
And that breaks my code. If I comment it out, everything runs as expected. My code isn't super complicated or doing anything weird either.
The exact error is:
/tmp/ccapuHUe.o: In function `__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<int const, int>>>::decallocate(std::_Rb_tree_node<std::pair<int const, int>>*, unsigned int)`:
program.cpp:(.text._ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKiiEEE10deallocateEPS5_j[__gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<int const, int>>>::deallocate(std::_Rb_tree_node<std::pair<int const, int>>*, unsigned int)]+0xd: undefined reference to `operator delete(void*)`
/tmp/ccapuHue.0:(.eh_frame+0x4b): undefined reference to `__gxx_personality_v0`
collect2: ld returned 1 exit status
I have no idea what any of that means. I'm not even using other map functions, just the initialization (I'll add the other functions once I sort this out).
My gcc is version 4.3.6, if that matters.
Just to be certain, I tested the following code:
#include <map>
int main(int argc, char* argv[])
{
std::map<int, int> myMap;
return 0;
}
And that doesn't work either! I get the same error (Aside from the .text location)!
Am I doing something wrong? The Documentation for C++ Map Constructors show that this is a valid construct. Is something wrong with my computer or something?