Error compile “CONDITION_VARIABLE undeclared”

孤街浪徒 提交于 2019-12-12 02:48:35

问题


sorry for my bad english if it's bad.

my code

#include <windows.h>

int     main(void)
{
    CONDITION_VARIABLE      cond;

    return 0;
}

i have the following error when i compil.

CONDITION_VARIABLE undeclared

i have the same error than in this stackoverflow question, and i have seen in my Winbase.h file than i don't have the following typedef

typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE;

i have found where i can to find a better Winbase.h, i have found this site

http://source.winehq.org/source/include/winbase.h

But i want to know if i can replace my current Winbase.h file with a simple copy past of content of this site ? or there is a better method please ?

Bye.


回答1:


Support for CONDITION_VARIABLE was added in Windows Vista. You are using an older version of the Windows SDK if CONDITION_VARIABLE is not declared in the headers. Do not modify the SDK headers. You will need to obtain a recent version of the SDK (e.g. the Windows 8 SDK).




回答2:


Aren't you missing this:

 #include <condition_variable>

Goodluck!



来源:https://stackoverflow.com/questions/18564459/error-compile-condition-variable-undeclared

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!