Hi
I have just completely rebuild our solaris 8 SPARC box, including moving from sun studio 8 to sun studio 11. When I tried to compile our C++ application it fell over at a __stdcall declaration. Below is an example program.
bash-2.03$ which CC
/opt/SUNWspro/bin/CC
bash-2.03$ sunstudio --version
Sun Studio IDE 7.4 2005/10/13
bash-2.03$ CC ./test.cpp
"./test.cpp", line 4: Error: "," expected instead of "foo".
"./test.cpp", line 4: Error: A declaration was expected instead of "}".
"./test.cpp", line 9: Error: The function "foo" must have a prototype.
3 Error(s) detected.
bash-2.03$ cat test.cpp
#include <iostream>
#ifdef __cplusplus
extern "C" void __stdcall foo() { std::cout << "FOO\n" ; }
#endif
int main()
{
foo();
return 0;
}
The above works find if I remove __stdcall.
Interestingly I've also tried g++ and this also fails.
Any help would be much appreciated, I am completely stumped.
Thanks,
Mark