在stdafx.h中定义
extern int g_AccountBook;在另一个类中赋值
g_AccountBook=1;
出现如下错误oYoSoftDlg.obj : error LNK2001: unresolved external symbol "int g_AccountBook" (?g_AccountBook@@3HA)
Release/YoYoSoft.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
extern int g_AccountBook;在另一个类中赋值
g_AccountBook=1;
出现如下错误oYoSoftDlg.obj : error LNK2001: unresolved external symbol "int g_AccountBook" (?g_AccountBook@@3HA)
Release/YoYoSoft.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
解决方案 »
- 嗅探器 MFC程序崩溃?
- 做MFC能否结合FALSH来实现排序算法的动态演示?
- 怎么批量删除CTreeCtrl中符合条件的结点?
- ATL中如何将集合(Collection)定义成默认集合(default collection)???
- 大家来看看这个情况怎么是回事
- 一个菜鸟问题,100分!
- 有没有利用字体来创建画笔的方法(高分)
- 怎样在后台格式化硬盘不需要经过确认,谢谢
- CoCreateInstanceEx中获取ICatInformation
- 怎样再切分窗口中禁止用户拖动窗口的切分条,即禁止用户上下拖动改变两个View的大小
- lineto畫出來的東西刷新問題
- 新手请教--如果才能知道所有能使用的参数?(内详)
只是对g_AccountBook的声明,没有定义呀,在任一个cpp文件中加上
int g_AccountBook = 0;
大哥,8是得,,小弟是给不出了呀,,,唉,,级算太低了
#ifndef GEN_DEFINE_H
#define GEN_DEFINE_H
#include "ADODB.h"
extern CAdoDB g_adoDB;//数据库全局变量
extern int g_AccountBook;class CGeneralDef
{
public:
CGeneralDef(); virtual ~CGeneralDef();
};
#endif
#endif
.cpp
===========================================================================
#include "stdafx.h"
#include "GeneralDef.h"
CGeneralDef::CGeneralDef()
{
int g_AccountBook=0;
}
CGeneralDef::~CGeneralDef()
{
}
#include "GeneralDef.h"
int g_AccountBook=0;//////////////////加在这里就对了.......搞定
CGeneralDef::CGeneralDef()
{
}
CGeneralDef::~CGeneralDef()
{
}