这个错误怎么改呀?unresolved external symbol "public: void __thiscall CWnd::SetWindowText

cici2006 2005-07-12 03:30:06
error LNK2001: unresolved external symbol "public: void __thiscall CWnd::SetWindowText(char const *)"

这个错误怎么改呀。
我把其中的一个CPP中的SetWindowText()屏蔽掉,就少一个LINK错误,这是为什么呢?怎么会这样呢?求救喔。
做的好好的,全编译一下怎么就有这样的错误呢》?
...全文
897 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
laolaoliu2002 2005-07-12
  • 打赏
  • 举报
回复
保留.dsp文件,将其他的工程文件删除,重建
cici2006 2005-07-12
  • 打赏
  • 举报
回复
谢谢各位大哥,VC也这样不稳定。我刚才用GHOST还原系统,VC也一起还原了。
居然一点错也没有。唉。怎么这样呢。我以前以为这只有BC有这样那样的问题,

没有想到VC也有这样那样的莫名的问题。唉。搞的我浪费了一下午呀。
casinosun 2005-07-12
  • 打赏
  • 举报
回复
setting的问题,重新建个工程试试
teli_eurydice 2005-07-12
  • 打赏
  • 举报
回复
呵呵,我碰见过 VC的问题,下载一个好点的版本
38062708 2005-07-12
  • 打赏
  • 举报
回复
有可能是你VC有问题,你拿到别的机器上编译看怎样
cici2006 2005-07-12
  • 打赏
  • 举报
回复
m_pMainWnd->SetWindowText(_T("ABC"));就是这样一个简单的句子都会有LINK错误喔.都晕死了.
m_pMainWnd是这个主窗口呀.晕喔.救我呀.
laolaoliu2002 2005-07-12
  • 打赏
  • 举报
回复
// set the text in IDC_MYEDIT
CWnd* pWnd = GetDlgItem(IDC_MYEDIT);
pWnd->SetWindowText(_T("Hockey is best!"));
cici2006 2005-07-12
  • 打赏
  • 举报
回复
大哥,我真的不需要CSDN中的解释呀。我这个SETWINDWOTEXT的函数原来还可以用。但是重新编绎就不能用了呀。我把其中的一个CPP的这个函数全屏蔽掉就少一个LINK错误是
要怎么样改呀。我不可能把所有的都屏蔽掉吧。我需要这个设置窗口标题之类呀。
becool3000 2005-07-12
  • 打赏
  • 举报
回复
不好意思啊
帮不上忙
顶~~~~~~~~~~
学习中
laolaoliu2002 2005-07-12
  • 打赏
  • 举报
回复
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.
cici2006 2005-07-12
  • 打赏
  • 举报
回复
楼上告诉我解决的办法呀。好不?好急喔。:(
cici2006 2005-07-12
  • 打赏
  • 举报
回复
救我呀。
laolaoliu2002 2005-07-12
  • 打赏
  • 举报
回复
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).

16,551

社区成员

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

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

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