|
-
February 26th, 2002, 05:25 AM
#1
atexit throwing compiler error
I am defining a function in a C++ class which is being used in a C++ win32 console application.
I am passing that function in atexit and keep getting compiler error.
error C2664: 'atexit' : cannot convert parameter 1 from 'void (void)' to 'void (__cdecl *)(void)'
I have checked and I am including the right header files i.e stdlib.h
If anyone knows how to get this function to work would be grateful for any
suggestions.
Regards,
Riaz Awan
-
February 26th, 2002, 07:48 AM
#2
Re: atexit throwing compiler error
Try casting:
atexit( (void (__cdecl *)(void)) fn1 );
or define your exit function exactly as compiler wants:
void __cdecl fn1(void))
{
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|