用vc2002定义CString出错
做一个简单的Hello World主要程序如下void helloWorld()
{
CString a;
acutPrintf("\nHello World!");
}
在编译时出现“ error C2065: “CString” : 未声明的标识符 “不知道有没有人遇到过。我想CString是系统类型不应当是没加引用文件吧.
我还真没遇到过,把您的源文件传上来看看。 你必须加入MFC支持,具体要包含哪个头文件和LIB我不清楚 我吧文件传上来,版主帮我看一下。在HelloWorld.cpp中的26行.
void helloWorld()
{
CString a = "Hello World!";
acutPrintf(a);
} 我怎么传不了文件呀。 我是按 ObjectARX 2004\arxlabs 下的ObjectARXLabs.chm中的 step1 一步步做的只是将显示”HelloWord"部分改了。原码是
#include "stdafx.h"
#include
#include
//#include
//#include
void initApp();
void unloadApp();
void helloWorld();
void initApp()
{
// register a command with the AutoCAD command mechanism
acedRegCmds->addCommand("HELLOWORLD_COMMANDS",
"Hello",
"Bonjour",
ACRX_CMD_TRANSPARENT,
helloWorld);
}
void unloadApp()
{
acedRegCmds->removeGroup("HELLOWORLD_COMMANDS");
}
void helloWorld()
{
CString a = "Hello World!";
acutPrintf(a);
}
extern "C" AcRx::AppRetCode
acrxEntryPoint(AcRx::AppMsgCode msg, void* pkt)
{
switch (msg)
{
case AcRx::kInitAppMsg:
acrxDynamicLinker->unlockApplication(pkt);
acrxRegisterAppMDIAware(pkt);
initApp();
break;
case AcRx::kUnloadAppMsg:
unloadApp();
break;
default:
break;
}
return AcRx::kRetOK;
}
#include to dipenghao 加了#include后出现以下错误。
d:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include\afxv_w32.h(18): fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include
我用的是VC7.0做的一个ARX,你有遇到过吗?
#include改成 #include TO easypower 我上边以包含 stdafx.h 了
#include "stdafx.h"
#include
#include
//#include
//#include
页:
[1]