| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1971 人关注过本帖
标题:[求助]关于error LNK2001: unresolved external symbol
只看楼主 加入收藏
m8311011725
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2006-3-11
收藏
 问题点数:0 回复次数:2 
[求助]关于error LNK2001: unresolved external symbol

// MainFrm.cpp : implementation of the CMainFrame class
//

#include "stdafx.h"
#include "Bayes.h"

#include "MainFrm.h"
#include "PaneCtrl.h"
#include "PaneDataBrowse.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMainFrame

IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)

BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_COMMAND_EX(CG_ID_VIEW_WORKSPACE, OnBarCheck)
ON_UPDATE_COMMAND_UI(CG_ID_VIEW_WORKSPACE, OnUpdateControlBarMenu)
END_MESSAGE_MAP()

static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};

/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction

CMainFrame::CMainFrame()
{
// TODO: add member initialization code here

}

CMainFrame::~CMainFrame()
{
}

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;

if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}

if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}

// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
InitWorkShop();
return 0;
}

int CMainFrame::InitWorkShop()
{
m_ImageList.Create(IDB_IMAGELIST, 13, 1, RGB(0,255,0));

// CG: The following block was inserted by the 'Dialog Bar' component
{
m_wndWorkspace.SetBtnImageList (&m_ImageList);
// m_wndWorkspace.SetMenuID(IDR_POPUP);

// Initialize dialog bar m_wndWorkspace
if (!m_wndWorkspace.Create(this, CG_ID_VIEW_WORKSPACE,
_T("Workspace"), CSize(330,200)))
{
TRACE0("Failed to create dialog bar m_wndWorkspace\n");
return -1; // fail to create
}

// Add the views to the tab control.
m_wndWorkspace.AddView(_T("控制面板"), RUNTIME_CLASS(CPaneCtrl));
m_wndWorkspace.AddView(_T("数据浏览"), RUNTIME_CLASS(CPaneDataBrowse));
// Define the image list to use with the tab control
m_TabImages.Create (IDB_IL_TAB, 16, 1, RGB(0,255,0));
m_wndWorkspace.SetTabImageList(&m_TabImages);

// allow bar to be resized when floating
m_wndWorkspace.SetBarStyle(m_wndWorkspace.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

m_wndWorkspace.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndWorkspace, AFX_IDW_DOCKBAR_RIGHT);
}

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs

return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics

#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CFrameWnd::AssertValid();
}

void CMainFrame::Dump(CDumpContext& dc) const
{
CFrameWnd::Dump(dc);
}

#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers

Compiling...
MainFrm.cpp
Linking...
MainFrm.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CPaneDataBrowse::classCPaneDataBrowse" (?classCPaneDataBrowse@CPaneDataBrowse@@2UCRuntimeClass@@B)
MainFrm.obj : error LNK2001: unresolved external symbol "public: static struct CRuntimeClass const CPaneCtrl::classCPaneCtrl" (?classCPaneCtrl@CPaneCtrl@@2UCRuntimeClass@@B)
Debug/Bayes.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Creating browse info file...

Bayes.exe - 3 error(s), 0 warning(s)

搜索更多相关主题的帖子: symbol external unresolved 
2006-10-17 22:11
wfpb
Rank: 6Rank: 6
等 级:贵宾
威 望:29
帖 子:2188
专家分:0
注 册:2006-4-2
收藏
得分:0 
你的CPaneDataBrowse的cpp文件里没有加IMPLEMENT_DYNCREATE吧

[glow=255,red,2]wfpb的部落格[/glow] 学习成为生活的重要组成部分!
2006-10-18 08:48
m8311011725
Rank: 1
等 级:新手上路
帖 子:31
专家分:0
注 册:2006-3-11
收藏
得分:0 

CPaneDataBrowse的cpp文件里包含了IMPLEMENT_DYNCREATE宏,CPaneDataBrowse的h文件里也包含了相应的宏

2006-10-18 11:40
快速回复:[求助]关于error LNK2001: unresolved external symbol
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030917 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved