找回密码
 用户注册

QQ登录

只需一步,快速开始

查看: 5711|回复: 0

Windows平台下应用ACE编译一个简单例子

[复制链接]
发表于 2007-12-10 21:10:07 | 显示全部楼层 |阅读模式
Windows平台下应用ACE编译一个简单例子,经常出现的一个问题?

本人在Windows平台下应用ACE构造一个“server--client”的小例子,

用VC++6。0编译的,两个程序总是出现如下错误:

MainFrm.cpp:

C:\ACE_wrappers\ace/os.i:  'TryEnterCriticalSection' is not a member of a ' global namespace'

C:\ACE_wrappers\ace/os.i:  'TryEnterCriticalSection' undeclared identifier

新人求助,请高人详细指点,谢谢!

-----------------------------------------------------------------------
估计是头文件的windows版本有问题。
stdafx.h里面加上:

#ifndef WINVER    // 允许使用 Windows 95 和 Windows NT 4 或更高版本的特定功能。
#define WINVER 0x0500  //为 Windows98 和 Windows 2000 及更新版本改变为适当的值。
#endif

#ifndef _WIN32_WINNT  // 允许使用 Windows NT 4 或更高版本的特定功能。
#define _WIN32_WINNT 0x0500  //为 Windows98 和 Windows 2000 及更新版本改变为适当的值。
#endif      

#ifndef _WIN32_WINDOWS  // 允许使用 Windows 98 或更高版本的特定功能。
#define _WIN32_WINDOWS 0x0500 //为 Windows Me 及更新版本改变为适当的值。
#endif
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-5-3 18:44 , Processed in 0.011927 second(s), 6 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表