问个入门问题

vagromkiller 2004-10-18 05:32:11
把别人写的CXPButton的文件引入自己的工程中的,是一个关于自画button的文件。然后使用类向导加了一个button,类型是CXPButton。可编译时提示的错误是:
:\vc源代码\test\testdlg.h(23) : error C2146: syntax error : missing ';' before identifier 'm_Button'
f:\vc源代码\test\testdlg.h(23) : error C2501: 'CXPButton' : missing storage-class or type specifiers
f:\vc源代码\test\testdlg.h(23) : error C2501: 'm_Button' : missing storage-class or type specifiers
F:\Vc源代码\test\testDlg.cpp(76) : error C2065: 'm_Button' : undeclared identifier

不知道原因何在
...全文
51 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
vagromkiller 2004-10-18
  • 打赏
  • 举报
回复
ok了。
DentistryDoctor 2004-10-18
  • 打赏
  • 举报
回复
加了以后
Generating Code...
Linking...
test.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CXPButton::~CXPButton(void)" (??1CXPButton@@UAE@XZ)
testDlg.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CXPButton::~CXPButton(void)" (??1CXPButton@@UAE@XZ)
testDlg.obj : error LNK2001: unresolved external symbol "public: __thiscall CXPButton::CXPButton(void)" (??0CXPButton@@QAE@XZ)
Debug/test.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

将XPButton.cpp也加入工程。
DentistryDoctor 2004-10-18
  • 打赏
  • 举报
回复
对,少包含了头文件。#include "XPButton.h"
vagromkiller 2004-10-18
  • 打赏
  • 举报
回复
加了以后
Generating Code...
Linking...
test.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CXPButton::~CXPButton(void)" (??1CXPButton@@UAE@XZ)
testDlg.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CXPButton::~CXPButton(void)" (??1CXPButton@@UAE@XZ)
testDlg.obj : error LNK2001: unresolved external symbol "public: __thiscall CXPButton::CXPButton(void)" (??0CXPButton@@QAE@XZ)
Debug/test.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
alon21 2004-10-18
  • 打赏
  • 举报
回复
在声明 CXPButton m_Button; 的文件的开始处#include "XPButton.h"

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧