I've recently installed GCC and all seemed to be working fine until now.
I get very strange, unreadable (to me) error messages when i try to create a vector.
I am kinda still learning this vector stuff, and in doing so i m creating this little program to aswere one of my questions about vectors. But now i have a more important question. What do these errors mean?
Here is the code:
#include
#include
using namespace std;
int main ()
{
vector v;
/* int a = 3;
int b = 2;
v.push_back(a);
v.push_back(b);
v[0] = 10;
v[1] = 10;
printf ("%d %d",a ,b);
*/
}
As you can see, i've commented out most of the code so that im pretty sure the top line of function main() is causing the problemos.
Incase you cant tell from the program, im trying to find out if when adding an element to a vector, does the vector simply copy the element past into push_back() and put it in the vector, or does it obtain the objects address and add the reference in the vector?
However, thats not really the guestion i want answered anymore (although if you know it, that'd be good) The main question is, am i doing something wrong with this code, or is this a problem of my gcc? And has this been reported before? if so, is there a fix etc?
Heres the errors the above code is producing!
Projects:test> gcc -o vex vex.cpp
/t/cc8816321.o: Undefined symbol ___nw__FUlPv referenced from text segment
/t/cc8816321.o: Undefined symbol endl(ostream &) referenced from text segment
/t/cc8816321.o: Undefined symbol _cerr referenced from text segment
/t/cc8816321.o: Undefined symbol ___ls__7ostreamPCc referenced from text segment
/t/cc8816321.o: Undefined symbol ___ls__7ostreamPFR7ostream_R7ostream referenced from text segment