Hey everyone, I just started learning C++ and everything was going fine for a while but now when ever I try to compile something a get all these errors:
1 2 3 4 5 6 7 8 9 10
C:\DOCUME~1\dylan\LOCALS~1\Temp/ccZMUTUG.o:ptest.cpp:(.text+0xd): undefined refe
rence to `std::string::size() const'
C:\DOCUME~1\dylan\LOCALS~1\Temp/ccZMUTUG.o:ptest.cpp:(.text+0x60): undefined reference to `std::string::operator[](unsigned int) const'
C:\DOCUME~1\dylan\LOCALS~1\Temp/ccZMUTUG.o:ptest.cpp:(.text+0x9e): undefined reference to `std::string::operator[](unsignedint) const'
C:\DOCUME~1\dylan\LOCALS~1\Temp/ccZMUTUG.o:ptest.cpp:(.text+0xcc): undefined reference to `std::string::operator[](unsigned int) const'
C:\DOCUME~1\dylan\LOCALS~1\Temp/ccZMUTUG.o:ptest.cpp:(.text+0x141): undefined reference to `std::cout'
C:\DOCUME~1\dylan\LOCALS~1\Temp/ccZMUTUG.o:ptest.cpp:(.text+0x146): undefined reference to `std::ostream::operator<<(void const*)'
C:\DOCUME~1\dylan\LOCALS~1\Temp/ccZMUTUG.o:ptest.cpp:(.text+0x16f): undefined reference to `std::ios_base::Init::Init()'
C:\DOCUME~1\dylan\LOCALS~1\Temp/ccZMUTUG.o:ptest.cpp:(.text+0x18a): undefined reference to `std::ios_base::Init::~Init()'
collect2: ld returned 1 exit status
I'm using minGW and I tried reinstalling it but it just gets the same errors. I don't have a clue what they mean.
That's very weird. Standard functions are defined in the headers, so you should never get linker errors. If the program compiled, it should link with no problems.
Post your code.