HP-SOCKET里面为什么会有 TryAcquireSRWLockShared 这种Win7上才有的函数
@伤神小怪兽 你好,想跟你请教个问题:我在我机器上用VS2008调用HP-SOCKET编译时错误,提示TryAcquireSRWLockShared 没有定义,我看了下MSDN,这个函数是WIN7以上才有的
请问为什么会使用这种函数呢,这样做出来的东西不是必须要WIN7以上才能运行么,求教,谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
vs2008 用最新的HP-socket 3.3.1
提示
error C2039: “TryAcquireSRWLockShared”: 不是“`global namespace'”的成员
到这里点一下“收藏”和“已用”呗,哈~ http://www.oschina.net/p/hp-socket
引用来自“待定”的评论
引用来自“伤神小怪兽”的评论
不会的,我就是用 XP 系统的,注意以下代码:
#if _WIN32_WINNT >= _WIN32_WINNT_WS08
typedef CSlimLock CSimpleRWLock;
#else
typedef CSWMR CSimpleRWLock;
#endif
详细错误描述是什么?
引用来自“待定”的评论
引用来自“伤神小怪兽”的评论
不会的,我就是用 XP 系统的,注意以下代码:
#if _WIN32_WINNT >= _WIN32_WINNT_WS08
typedef CSlimLock CSimpleRWLock;
#else
typedef CSWMR CSimpleRWLock;
#endif
详细错误描述是什么?
引用来自“伤神小怪兽”的评论
不会的,我就是用 XP 系统的,注意以下代码:
#if _WIN32_WINNT >= _WIN32_WINNT_WS08
typedef CSlimLock CSimpleRWLock;
#else
typedef CSWMR CSimpleRWLock;
#endif
详细错误描述是什么?
1>------ Build started: Project: ghserver, Configuration: Debug Win32 ------
1>Compiling...
1>ghserver.cpp
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(64) : error C2039: 'TryAcquireSRWLockShared' : is not a member of '`global namespace''
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(64) : error C3861: 'TryAcquireSRWLockShared': identifier not found
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(65) : error C2039: 'TryAcquireSRWLockExclusive' : is not a member of '`global namespace''
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(65) : error C3861: 'TryAcquireSRWLockExclusive': identifier not found
1>bufferpool.cpp
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(64) : error C2039: 'TryAcquireSRWLockShared' : is not a member of '`global namespace''
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(64) : error C3861: 'TryAcquireSRWLockShared': identifier not found
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(65) : error C2039: 'TryAcquireSRWLockExclusive' : is not a member of '`global namespace''
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(65) : error C3861: 'TryAcquireSRWLockExclusive': identifier not found
1>RWLock.cpp
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(64) : error C2039: 'TryAcquireSRWLockShared' : is not a member of '`global namespace''
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(64) : error C3861: 'TryAcquireSRWLockShared': identifier not found
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(65) : error C2039: 'TryAcquireSRWLockExclusive' : is not a member of '`global namespace''
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(65) : error C3861: 'TryAcquireSRWLockExclusive': identifier not found
1>TcpServer.cpp
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(64) : error C2039: 'TryAcquireSRWLockShared' : is not a member of '`global namespace''
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(64) : error C3861: 'TryAcquireSRWLockShared': identifier not found
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(65) : error C2039: 'TryAcquireSRWLockExclusive' : is not a member of '`global namespace''
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(65) : error C3861: 'TryAcquireSRWLockExclusive': identifier not found
1>SocketHelper.cpp
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(64) : error C2039: 'TryAcquireSRWLockShared' : is not a member of '`global namespace''
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(64) : error C3861: 'TryAcquireSRWLockShared': identifier not found
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(65) : error C2039: 'TryAcquireSRWLockExclusive' : is not a member of '`global namespace''
1>d:cghcodefvckghserverghservercommonsrcrwlock.h(65) : error C3861: 'TryAcquireSRWLockExclusive': identifier not found
1>Generating Code...
1>Build log was saved at "file://d:cghcodefvckghserverghserverDebugBuildLog.htm"
不会的,我就是用 XP 系统的,注意以下代码:
#if _WIN32_WINNT >= _WIN32_WINNT_WS08
typedef CSlimLock CSimpleRWLock;
#else
typedef CSWMR CSimpleRWLock;
#endif
详细错误描述是什么?
引用来自“待定”的评论
引用来自“伤神小怪兽”的评论
不会的,我就是用 XP 系统的,注意以下代码:
#if _WIN32_WINNT >= _WIN32_WINNT_WS08
typedef CSlimLock CSimpleRWLock;
#else
typedef CSWMR CSimpleRWLock;
#endif
详细错误描述是什么?