Quote:Original post by TylerMoore
What is CRT? C Runtime Library?(Novice here)
Yes. Although to be more accurate, I guess I should have said "C++ standard library".
Anyway, the idea is, every compiler has a bunch of C++ code which it implements behind the scenes. This contains the implementation for std::string, std::vector, and lots of other stuff.
So like any C++ code, there are the headers and there is the implementation. When you write a function header, it's like a promise to the compiler that says, "I promise that at link time, you'll find a function that looks like this." So the VS 6.0 standard library headers contained, among other things, a promise that said "I promise you'll find functions called _Xran and _Xlen".
But the actual implementation for that code is in a separate .lib file (or maybe several lib files) which is also provided by the compiler. These have names like libc.lib, or libcmt.lib, or msvcrt.lib.
So like any C++ code, you can get problems if the headers don't match up with the libraries, which is what happened when someone tried to take a library built against the VS 6.0 standard library, and linked it against the 2003 standard library. The promise to find the functions _Xran and _Xlen was broken! So some guy wrote those functions to make the linker happy.
Now the problem you have today is just a syntax error. You can't define a function inside a namespace like that, unless that function is predeclared inside a "namespace{}" block.
But anyway, the best bet is to just delete those functions because, 1) You're not supposed to define anything inside the std namespace, and 2) You're not supposed to have anything that has a name that starts with an underscore followed by a capital letter. Both of those conventions are reserved by the compiler. So if deleting those functions fixes your build errors, then I would not be worried about it.