Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sun studio 11 CC compile error when using __stdcall

807575Apr 22 2008 — edited Apr 22 2008
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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 20 2008
Added on Apr 22 2008
2 comments
225 views