博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
TryEnterCriticalSection: identifier not found
阅读量:4181 次
发布时间:2019-05-26

本文共 415 字,大约阅读时间需要 1 分钟。

原因:虽然包含了windows.h,但未定义_WIN32_WINNT。

因为在winbase.h (包含在windows.h中) 中, TryEnterCriticalSection只有定义了_WIN32_WINNT 且 _WIN32_WINNT>= 0x0400 时才会被定义。所以解决方法是在编译选项中加入 /D "_WIN32_WINNT=0x0500"。

附:_WIN32_WINNT 与 windows 版本的对应关系

_WIN32_WINNT Windows 版本
0x0500 Windows 2000
0x0501 Windows XP
0x0502 Windows Server 2003
0x0600 Windows Vista
0x0601 Windows 7

 Reference:

1. 修改WINVER和_WIN32_WINNT:

2. TryEnterCriticalSection function:

转载地址:http://vxhai.baihongyu.com/

你可能感兴趣的文章
vue2.0之非父子组件通信
查看>>
如何建立svn版本库并运行它
查看>>
如何合并svn分支到主干上
查看>>
libusb源码学习:list_entry
查看>>
libusb源码学习:几个函数加载的宏(windows)
查看>>
MCU_如何通过硬件VID 查找生产厂家
查看>>
NCNN部署例程 mxnet-gluoncv之simple_pose
查看>>
Ubuntu18.04查看显卡信息并安装NVDIA显卡驱动driver + Cuda + Cudnn
查看>>
电子元件二极管封装SMA,SMB,SMC的区别
查看>>
ALTERA verilog Error (12007): Top-level design entity is undefined
查看>>
VS2019 LINK Error 无法找到 mscoree.lib
查看>>
Verilog_MyHDL的使用
查看>>
VisualStudio2019的怪问题,在_Container_base12::_Orphan_all引发了异常: 读取访问权限冲突
查看>>
相机技术--摄像机720p、1080p、2mp、3mp、5mp;VGA, QHD, FHD, 2K,4K对应的分辨率分别是什么
查看>>
Android四大组件之Service示例
查看>>
Android四大组件Service之前台进程(201807最新源码)
查看>>
实战Android:用AccessibilityService捕获volume按键
查看>>
实战Android:通过BroadcastReceiver监听Home,电源Power,和音量变化Volume键
查看>>
Android Studio错误:找不资源文件包 -- Cannot resolve symbol "R"
查看>>
实战Android:图片处理之ColorMatrix和Matrix实例
查看>>