0

我有一些用于控制 wifi 模块的示例代码,告诉我使用 VC 6.0,并且不支持较新的版本。无论如何,我正在努力让它工作。它使用 CString,它是 MFC 的一部分,所以我下载了 Visual Studio 2010 的试用版,看看是否可以编译它。这是引发(开始)错误的代码:

#ifdef _UNICODE  
//Use CString as the standard string type in UNICODE versions
typedef CString WuString; // Line 42
#endif

这是错误消息:

1>d:\...\my documents\authapiex\apps8.0.0.90_sdk_xp\include\wtypes.h(42): error C2146: syntax error : missing ';' before identifier 'WuString'
1>d:\...\my documents\authapiex\apps8.0.0.90_sdk_xp\include\wtypes.h(42): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\...\my documents\authapiex\apps8.0.0.90_sdk_xp\include\wtypes.h(42): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

任何帮助都会很棒。

4

2 回答 2

0

您缺少 CString 的包含。

#include <afx.h>
于 2010-06-23T14:55:06.197 回答
0

看起来 CString 没有在您放入 typedef 的地方定义。您需要确保在 typedef 之前包含适当的包含文件。

于 2010-06-23T14:55:54.093 回答