error LNK2001: 无法解析的外部符号 ,求指点啊

wumin940590725 2014-03-05 10:16:08
error LNK2001: 无法解析的外部符号 "protected: static struct AFX_MSGMAP const * __stdcall CDialog::GetThisMessageMap(void)" (?GetThisMessageMap@CDialog@@KGPBUAFX_MSGMAP@@XZ) SmartPointerDlg.obj

这个我的理解是GetThisMessageMap没有被申明,但是我添加了afxwin.h这个头文件,请问怎么还有问题啊,好奇怪啊

从vc6.0迁移到vs2008出现问题。
...全文
2755 18 打赏 收藏 转发到动态 举报
写回复
用AI写文章
18 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2014-07-14
  • 打赏
  • 举报
回复
引用 17 楼 zhanglidn013 的回复:
[quote=引用 16 楼 zhao4zhong1 的回复:] http://www.baidu.com/s?wd=GetThisMessageMap+site%3Amicrosoft.com&rsv_bp=0&ch=&tn=baidu&bar=&rsv_spt=3&ie=utf-8&inputT=7047 https://www.google.com.hk/search?hl=zh-CN&source=hp&q=GetThisMessageMap&btnG=Google+%E6%90%9C%E7%B4%A2&gbv=2
google 怎么打不开[/quote] 在c:\windows\system32\drivers\etc\hosts文件后面添加以下内容:
91.213.30.151     www.google.com
91.213.30.151     google.com
74.125.20.31      www.google.com.hk
74.125.20.31      accounts.google.com
74.125.20.31      accounts.l.google.com
74.125.20.31      google.com
74.125.20.31      www.google.com
74.125.20.31      csi.gstatic.com
74.125.20.31      ssl.gstatic.com
74.125.20.31      ssl.google-analytics.com
74.125.20.31      www.google-analytics.com7
74.125.20.31      scholar.google.com
74.125.20.31      safebrowsing.google.com
74.125.20.31      gmail.com
74.125.20.31      mail.google.com
74.125.20.31      play.google.com
74.125.20.31      news.google.com
74.125.20.31      plus.google.com
74.125.20.31      code.google.com
74.125.20.31      tools.google.com
74.125.20.31      productforums.google.com
74.125.20.31      translate.google.com
74.125.20.31      chrome.google.com
74.125.20.31      youtube.com
74.125.20.31      www.youtube.com3
74.125.20.31      talk.google.com
74.125.20.31      talkgadget.google.com
74.125.20.31      apis.google.com
74.125.20.31      clients1.google.com
74.125.20.31      clients2.google.com
74.125.20.31      clients3.google.com
74.125.20.31      clients4.google.com
74.125.20.31      clients5.google.com
74.125.20.31      clients6.google.com
74.125.20.31      clients7.google.com
74.125.20.31      googleusercontent.com
74.125.20.31      lh1.googleusercontent.com
74.125.20.31      lh2.googleusercontent.com
74.125.20.31      lh3.googleusercontent.com
74.125.20.31      lh4.googleusercontent.com
74.125.20.31      lh5.googleusercontent.com
74.125.20.31      lh6.googleusercontent.com
74.125.20.31      lh7.googleusercontent.com
74.125.20.31      local.google.com
74.125.20.31      m.google.com
74.125.20.31      map.google.com
74.125.20.31      maps.google.com
74.125.20.31      maps.google.com.hk
74.125.20.31      maps.l.google.com
74.125.20.31      maps-api-ssl.google.com
74.125.20.31      maps.gstatic.com
74.125.20.31      maps.googleapis.com
74.125.20.31      gmaps-samples-flash.googlecode.com
74.125.20.31      earth.google.com
74.125.20.31      earth-api-samples.googlecode.com
74.125.20.31      earthengine.googlelabs.com
wumin940590725 2014-07-11
  • 打赏
  • 举报
回复
引用 12 楼 zzdmfk 的回复:
你最好用2008新建一个mfc程序看看,2008与6.0很多库函数返回值类型都不同,比如void变成了hresult,这样的话你必须返回一个值。
但是如您所说的话报的错就不是这种了吧
wumin940590725 2014-07-11
  • 打赏
  • 举报
回复
引用 14 楼 zhao4zhong1 的回复:
GetThisMessageMap没实现。
但是getThisMessageMap是系统函数啊,系统函数不是vc6.0安装的时候就自动默认安装的嘛,难道2008重写了这个函数?我看了好像没有啊
赵4老师 2014-07-11
  • 打赏
  • 举报
回复
GetThisMessageMap没实现。
路人乙2019 2014-04-19
  • 打赏
  • 举报
回复
你最好用2008新建一个mfc程序看看,2008与6.0很多库函数返回值类型都不同,比如void变成了hresult,这样的话你必须返回一个值。
wumin940590725 2014-04-19
  • 打赏
  • 举报
回复
没有人知道吗?求大神指点啊
wumin940590725 2014-03-17
  • 打赏
  • 举报
回复
引用 9 楼 rivershan 的回复:
可能是你头文件引用顺序不对..
stdafx.h中不对??是这个意思吗?
rivershan 2014-03-17
  • 打赏
  • 举报
回复
可能是你头文件引用顺序不对..
wumin940590725 2014-03-14
  • 打赏
  • 举报
回复
引用 6 楼 zgl7903 的回复:
主要是这个缺少的是在CWnd这个系统库中的,所以我就不知道怎么改了。个人估计是写了申明没有写实现。但是系统库怎么会有这种问题。。。。。。。。。。。。。。。 错误 260 error LNK2019: 无法解析的外部符号 "public: virtual long __thiscall CWnd::get_accSelection(struct tagVARIANT *)" (?get_accSelection@CWnd@@UAEJPAUtagVARIANT@@@Z),该符号在函数 "protected: void __thiscall CGlassDialog::OnTimer(unsigned int)" (?OnTimer@CGlassDialog@@IAEXI@Z) 中被引用 GlassDialog.obj
void CGlassDialog::OnTimer(UINT nIDEvent)
{
	if( nIDEvent == IDT_TIMER_CREATE )
		MakeGlass();
	if( nIDEvent == IDT_TIMER_DESTROY )
		MakeTransparent();
	CDialog::OnTimer(nIDEvent);
}
wumin940590725 2014-03-14
  • 打赏
  • 举报
回复
引用 6 楼 zgl7903 的回复:
估计是缺少了消息映射段 .H DECLARE_MESSAGE_MAP .cpp BEGIN_MESSAGE_MAP END_MESSAGE_MAP
有的 BEGIN_MESSAGE_MAP(CSmartPointerApp, CWinApp) ON_COMMAND(ID_HELP, OnHelp) END_MESSAGE_MAP()
zgl7903 2014-03-14
  • 打赏
  • 举报
回复
估计是缺少了消息映射段 .H DECLARE_MESSAGE_MAP .cpp BEGIN_MESSAGE_MAP END_MESSAGE_MAP
wumin940590725 2014-03-13
  • 打赏
  • 举报
回复
引用 2 楼 ouyh12345 的回复:
error LNK2001: 无法解析的外部符 不是没声明,而是没找到定义 确定已经重载了这个函数?
我发现把链接从动态改为静态就没问题了,但是我的程序应用要求必须是静态啊,好郁闷。 错误 501 error LNK2019: 无法解析的外部符号 "public: virtual int __thiscall CFile::Open(wchar_t const *,unsigned int,class CFileException *)" (?Open@CFile@@UAEHPB_WIPAVCFileException@@@Z),该符号在函数 "public: void __thiscall CSmartPointerApp::OutPutLog(class ATL::CStringT<wchar_t,class StrTraitMFC<wchar_t,class ATL::ChTraitsCRT<wchar_t> > >)" (?OutPutLog@CSmartPointerApp@@QAEXV?$CStringT@_WV?$StrTraitMFC@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@@Z) 中被引用 SmartPointer.obj
void CSmartPointerApp::OutPutLog( CString str)
{
	CFile File;
	CString strSaveDataPath;
	strSaveDataPath = m_strProgramPath + _T("\\DebugInfo.log");
	if( File.Open(strSaveDataPath,CFile::modeReadWrite|CFile::modeNoInherit ) )
	{
		CTime tm;
		CString strTime,strTemp;
		tm = CTime::GetCurrentTime();
		strTime = tm.Format(_T("%Y-%m-%d %H:%M:%S "));
		strTemp = strTime+str+_T("\r\n");

		DWORD dwLength = File.SeekToEnd();
		if(dwLength >10000)
		{
			File.SetLength(0);
		}
		File.Write(strTemp, strTemp.GetLength()*2);
		File.Close();
	}
而红色标出的open是在afx.h中的File类的调用函数。求大神看看啊,谢谢
wumin940590725 2014-03-05
  • 打赏
  • 举报
回复
afxwin.h不是MFC的主要头文件吗?我原来还有个atl问题,加了atlbase.h之后就好了,但是这个死活没用,郁闷
wumin940590725 2014-03-05
  • 打赏
  • 举报
回复
引用 2 楼 ouyh12345 的回复:
error LNK2001: 无法解析的外部符 不是没声明,而是没找到定义 确定已经重载了这个函数?
??????这些函数都是MFC的系统函数啊。。。。。。
ouyh12345 2014-03-05
  • 打赏
  • 举报
回复
error LNK2001: 无法解析的外部符 不是没声明,而是没找到定义 确定已经重载了这个函数?
wumin940590725 2014-03-05
  • 打赏
  • 举报
回复
其实可以确定就是afxwin.h的问题,但是奇怪的是我加了他的头文件为什么没效果呢??

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

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