Hello,
I downloaded the “recommended” windows binary today, and find several of my macros from my UNIX boxen not working. I have discovered that it’s because strcat is not functioning under win32, though it works just fine on Solaris 10 and OS X 10.4.
Here’s a simple function example:
void teststrings(const char* label) {
char* name = new char*;
cout << "1) NAME: " << name << "\tLABEL: " << label << endl;
strcpy(name,"base");
cout << "2) NAME: " << name << "\tLABEL: " << label << endl;
strcat(name,label);
cout << "3) NAME: " << name << "\tLABEL: " << label << endl;
}
Under Solaris:
Version 4.00/02, 24 February 2004
Compiled for SolarisCC5
CINT/ROOT C/C++ Interpreter 5.15.123, Feb 9 2004
root [0] .L teststrings.C
root [1] teststrings(“hello”)
- NAME: LABEL: hello
- NAME: base LABEL: hello
- NAME: basehello LABEL: hello
Under OS X:
Version 5.14/00, 29 December, 2006
Compiled for macosx with thread support
CINT/ROOT C/C++ Interpreter 5.16.06, November 24, 2006
root [0] .L teststrings.C
root [1] teststrings(“hello”)
- NAME: LABEL: hello
- NAME: base LABEL: hello
- NAME: basehello LABEL: hello
Under win XP
Version 5.14/00, 14 December, 2006
Compiled for win32
CINT/ROOT C/C++ Interpreter 5.16.06, November 24, 2006
root [0] .L teststrings.C
root [1] teststrings(“hello”)
- NAME: LABEL: hello
- NAME: base LABEL: hello
- NAME: base LABEL: hello
I found one thread (root.cern.ch/phpBB2/viewtopic.php?t=1434) that seemed to indicate that Philippe found an error in the MS compiler, but this was supposedly fixed in 2005???
Any ideas as to what happened? Is there a “fixed” or non-optimized build for winXP that has a working strcat?
Many kind thanks,
-Don