Click here to Skip to main content
15,881,380 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<code>typedef int (__stdcall * myfunc) (int);

int main() {return 0;}
</code>

# g++ Test1.cpp
Test1.cpp:1: error: expected ')' before '*' token

Why?
Thanks
Posted

__stdcall is Microsoft specific so will not be part of the standard language accepted by the gcc/g++ compiler.
 
Share this answer
 
Is there a similar keyword to declare calling convention?
 
Share this answer
 
Comments
Richard MacCutchan 22-Aug-10 5:42am    
Yes I expect so, but you will have to look in the compiler documentation to find it.
If you're using the MinGW port of gcc there's probably a stdcall implementation for calling windows API functions. However you'll have to look in the gcc docs to find out what it is (or look in the MingGW windows.h and see how it decorates windows API function prototypes).

If you're not using MinGW (or one of the other Windows ports of gcc) then there's no need to use stdcall - the default calling convention is probably okay for anything you'd want to do.

Cheers,

Ash
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900