Hi,
I have a class GetCurrentTime and constructors GetCurrentTime() and ~GetCurrentTime().
When I try to compile it I get a compilation error -
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
error C2523: 'namespace::GetCurrentTime::~GetTickCount' : destructor type mismatch
and some other similar errors.
I found out that my program includes Winbase.h which has a line
#define GetCurrentTime() GetTickCount()
which is causing all the errors.
Is there any workaround for this error without me having to change the class name (as that would be very troublesome). Thanks for the help.
Regards,
Harsha
GetCurrentTime() compilation error due to Winbase.h
Started by harshareddy75, Jun 16 2010 02:56 AM
3 replies to this topic
#1
Posted 16 June 2010 - 02:56 AM
|
|
|
#2
Posted 16 June 2010 - 02:59 AM
You could use undef, ie:
I would just change the class name though, that might break some code.
#ifdef GetCurrentTime #undef GetCurrentTime #endif
I would just change the class name though, that might break some code.
std::string s("oberq zhpu?");std::for_each(s.begin(),s.end(),[&](char&c){c=~c;c=~c-0x01/(~(c|0x20)/0x0D*0x02-0x0B)*0x0D;});std::cout<<s;
#3
Posted 16 June 2010 - 07:05 PM
As long as you don't call GetCurrentTime anywhere, you can do a project-wide replace with your new class name. I forget the actual dialog box, but if you hit CTRL+H it should be an option on there. I really do not recommend undefining GetCurrentTime(). Seriously.
sudo rm -rf /
#4
Posted 16 June 2010 - 08:10 PM
Thank you for your replies. I guess I will just change the class name.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









