vs2008 连接问题集锦
2013-09-18 13:01
253 查看
在使用vs2008总是会碰到到一些问题,为了以后不再到处找解决办法,就自己先总结下。
问题描述1:
自己这边是完全可以运行,可是一把代码发给其他同事编译运行时,就报下面错误。(属性配置是一样的,把代码发我这还是可以运行)
>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: __thiscall CWinAppEx::CWinAppEx(int)" (??0CWinAppEx@@QAE@H@Z)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CWinAppEx::~CWinAppEx(void)" (??1CWinAppEx@@UAE@XZ)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall CWinAppEx::GetRuntimeClass(void)const " (?GetRuntimeClass@CWinAppEx@@UBEPAUCRuntimeClass@@XZ)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::ExitInstance(void)" (?ExitInstance@CWinAppEx@@UAEHXZ)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::LoadState(char const *,class CFrameImpl *)" (?LoadState@CWinAppEx@@UAEHPBDPAVCFrameImpl@@@Z)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::CleanState(char const *)" (?CleanState@CWinAppEx@@UAEHPBD@Z)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::SaveState(char const *,class CFrameImpl *)" (?SaveState@CWinAppEx@@UAEHPBDPAVCFrameImpl@@@Z)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::OnViewDoubleClick(class CWnd *,int)" (?OnViewDoubleClick@CWinAppEx@@UAEHPAVCWnd@@H@Z)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::ShowPopupMenu(unsigned int,class CPoint const &,class CWnd *)" (?ShowPopupMenu@CWinAppEx@@UAEHIABVCPoint@@PAVCWnd@@@Z)
解决办法:
网上大多说的这类似问题是解决自定义类的,可是这个连接是系统CWinAppEx,网上查了很久也没找到原因,重装了vs也没解决。后面在google上无意中看到有个回复说是vs2008少装了sp1补丁,问了下同事,还真没装这个补丁,装上之后解决该问题了。
问题描述2:
将旧代码更新到新代码时,由于没使用svn只能手动修改原有的老代码,对比着修改,改完一编译,报下面两种错误:
error BK1506:cannot open file '.\Debug\XXXXX.sbr':No such file or dire.
解决办法:
右击工程->Properties->C/C++->Browse Information -----Enable Browse Information 设置为NONE
error C2872: 'string' : ambiguous symbol
解决办法:
找工程中有多少个using namespace std;或者查找包含“string.h”头文件的地方,将不用的去掉,特别是“using namespace std”,改用头文件就行了
问题描述3:
error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject“
解决办法:
由于自己没有使用=来赋值,所以找问题原因时花费较长时间。后面发现,我定义了一个CArray<A,A&>XX,A是一个结构体,里面包含了一个CEvent成员,在XX.Add(ss)时候,系统内部会调用赋值函数,导致这个问题的出现。解决它就是自己写个赋值函数或者换种方式调用类私有成员
问题描述1:
自己这边是完全可以运行,可是一把代码发给其他同事编译运行时,就报下面错误。(属性配置是一样的,把代码发我这还是可以运行)
>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: __thiscall CWinAppEx::CWinAppEx(int)" (??0CWinAppEx@@QAE@H@Z)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CWinAppEx::~CWinAppEx(void)" (??1CWinAppEx@@UAE@XZ)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual struct CRuntimeClass * __thiscall CWinAppEx::GetRuntimeClass(void)const " (?GetRuntimeClass@CWinAppEx@@UBEPAUCRuntimeClass@@XZ)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::ExitInstance(void)" (?ExitInstance@CWinAppEx@@UAEHXZ)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::LoadState(char const *,class CFrameImpl *)" (?LoadState@CWinAppEx@@UAEHPBDPAVCFrameImpl@@@Z)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::CleanState(char const *)" (?CleanState@CWinAppEx@@UAEHPBD@Z)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::SaveState(char const *,class CFrameImpl *)" (?SaveState@CWinAppEx@@UAEHPBDPAVCFrameImpl@@@Z)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::OnViewDoubleClick(class CWnd *,int)" (?OnViewDoubleClick@CWinAppEx@@UAEHPAVCWnd@@H@Z)
1>NMEALogAnalyzer.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CWinAppEx::ShowPopupMenu(unsigned int,class CPoint const &,class CWnd *)" (?ShowPopupMenu@CWinAppEx@@UAEHIABVCPoint@@PAVCWnd@@@Z)
解决办法:
网上大多说的这类似问题是解决自定义类的,可是这个连接是系统CWinAppEx,网上查了很久也没找到原因,重装了vs也没解决。后面在google上无意中看到有个回复说是vs2008少装了sp1补丁,问了下同事,还真没装这个补丁,装上之后解决该问题了。
问题描述2:
将旧代码更新到新代码时,由于没使用svn只能手动修改原有的老代码,对比着修改,改完一编译,报下面两种错误:
error BK1506:cannot open file '.\Debug\XXXXX.sbr':No such file or dire.
解决办法:
右击工程->Properties->C/C++->Browse Information -----Enable Browse Information 设置为NONE
error C2872: 'string' : ambiguous symbol
解决办法:
找工程中有多少个using namespace std;或者查找包含“string.h”头文件的地方,将不用的去掉,特别是“using namespace std”,改用头文件就行了
问题描述3:
error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject“
解决办法:
由于自己没有使用=来赋值,所以找问题原因时花费较长时间。后面发现,我定义了一个CArray<A,A&>XX,A是一个结构体,里面包含了一个CEvent成员,在XX.Add(ss)时候,系统内部会调用赋值函数,导致这个问题的出现。解决它就是自己写个赋值函数或者换种方式调用类私有成员
相关文章推荐
- 问题集锦13:数据库升级后,程序无法连接数据库
- vs2008在win8下无法连接sql2000的问题的解决
- 远程控制问题集锦(你的凭据不工作,之前用于连接到(服务器IP)的凭据无法工作,请输入新的凭据)
- JDBC连接数据库问题集锦
- Oracle Form Builder问题集锦(第一弹:连接报错:ORA-12154:TNS:无法解析指定的连接标识符)
- VS2008中项目连接字符串问题_C#
- vs2008自带的sqlserver2005连接问题
- WCF问题集锦:基础连接已经关闭 接收时发生错误
- 虚拟化VMWare问题集锦之一: vSphere Client无法连接到"192.168.1.224"
- vs2008编译连接出现的一个问题
- 问题集锦01:该用户与可信的SQL SERVER 连接无关联
- vs2008连接sql2005的问题(provider:命名管道提供程序,error:40-无法打开到 SQL Server 的连接)
- VS2008在做简单的ado.net连接数据库时出现的问题
- VS2008连接SQL2005问题,老连接不上。
- 请教关于vs2008英文版连接中文版的sql2005的问题
- MySql和VS2008连接遇到的问题
- VS2008 连接TFS的问题
- 问题集锦03:使用sqlcmd连接数据库出错
- VS2008连接sql2005的问题-Could not load file or assembly 'Microsoft.SqlServer.Management.Sdk.Sfc
- 一个 vs2008 无法连接到Asp.net Development Server的问题