小女子请教高手VC的问题

maomaobeidi 2003-09-21 08:28:12
LNK2001:是什么错误,怎么改呢

MSDN能买到盘吗


谢谢各位了
...全文
113 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
neptunez 2003-09-21
  • 打赏
  • 举报
回复
from MSDN

unresolved external symbol "symbol"

Code references something (such as a function, variable, or label) that the linker can't find in the libraries and object files.

Possible causes

What the code asks for doesn't exist (the symbol is spelled incorrectly or uses the wrong case, for example).
The code asks for the wrong thing (you are using mixed versions of the libraries, some from one version of the product, others from another version).
This error message is followed by fatal error LNK1120.

Specific causes

Coding Problems

If the LNK2001 diagnostic text reports that __check_commonlanguageruntime_version is an unresolved external symbol, see LNK2019 for information on how to resolve.
The definition of member template is outside the class. Visual C++ has a limitation in which member templates must be fully defined within the enclosing class. See KB article Q239436 for more information about LNK2001 and member templates.
Mismatched case in your code or module-definition (.def) file can cause LNK2001. For example, if you named a variable var1 in one C++ source file and tried to access it as VAR1 in another.
A project that uses function inlining yet defines the functions in a .cpp file rather than in the header file can cause LNK2001.
Calling a C function from a C++ program without using extern "C" (which causes the compiler to use the C naming convention) can cause LNK2001. Compiler options /Tp and /Tc cause the compiler to compile files as C or C++, respectively, regardless of the filename extension. These options can cause function names different from what you expect.
Attempting to reference functions or data that don't have external linkage can cause LNK2001. In C++, inline functions and const data have internal linkage unless explicitly specified as extern.
A missing function body or variable can cause LNK2001. With just a function prototype or extern declaration the compiler can continue without error, but the linker cannot resolve a call to an address or reference to a variable because there is no function code or variable space reserved.
Calling a function with parameter types that do not match those in the function declaration can cause LNK2001. Name decoration incorporates the parameters of a function into the final decorated function name.
Incorrectly included prototypes, which cause the compiler to expect a function body that is not provided can cause LNK2001. If you have both a class and non-class implementation of a function F, beware of C++ scope-resolution rules.
When using C++, including a function prototype in a class definition and failing to include the implementation of the function for that class can cause LNK2001.
Attempting to call a pure virtual function from the constructor or destructor of an abstract base class can cause LNK2001. A pure virtual function has no base class implementation.
Trying to access a static variable from outside the file in which it is declared can cause LNK2001. Functions declared with the static modifier by definition have file scope. Static variables have the same limitation.
Trying to use a variable declared within a function (a local variable) outside the scope of that function can cause LNK2001.
Trying to use a global constant in C++ in multiple files can cause LNK2001. In C++, unlike C, global constants have static linkage. To get around this limitation, you can include the const initializations in a header file and include that header in your .cpp files, or you can make the variable non-constant and use a constant reference to access it.
When building a Release version of an ATL project, indicates that CRT startup code is required. To fix, do one of the following,
Remove _ATL_MIN_CRT from the list of preprocessor defines to allow CRT startup code to be included. See General Configuration Settings Property Page for more information.
If possible, remove calls to CRT functions that require CRT startup code. Instead, use their Win32 equivalents. For example, use lstrcmp instead of strcmp. Known functions that require CRT startup code are some of the string and floating point functions.
reludson 2003-09-21
  • 打赏
  • 举报
回复
http://www.xian.cims.edu.cn/ftproot/public
reludson 2003-09-21
  • 打赏
  • 举报
回复
http://ku85.com/down/Index.asp
reludson 2003-09-21
  • 打赏
  • 举报
回复
你可以到下面的地方下载:
http://ku85.com/down/SoftView.asp?SoftID=575
maomaobeidi 2003-09-21
  • 打赏
  • 举报
回复
能不能具体点呢
lifeequation 2003-09-21
  • 打赏
  • 举报
回复
造成2001错误的原因还是很多的
玄豹 2003-09-21
  • 打赏
  • 举报
回复
MSDN可以买到,但很大哟!
huang_yu 2003-09-21
  • 打赏
  • 举报
回复
LNK2001:是什么错误,怎么改呢

回答MM:
一般错在你定义的函数上有问题。
xiaobeker 2003-09-21
  • 打赏
  • 举报
回复
有中文书上详细解说了lnk2001错误,你可以找来看:

人民邮电出版社《专家门诊——VISUAL C++开发答疑》
或者是:
机械工业出版社〈VISUAL C++应用技术与常见问题你问我答〉

一定在这两本书的某一本中,我读过。
realjustin 2003-09-21
  • 打赏
  • 举报
回复
MSDN 就是 Must See or Dong Ni
sunnysun44 2003-09-21
  • 打赏
  • 举报
回复
MSDN是何东东??解释一下呗,谢谢啊!!

2,586

社区成员

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

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