C++执行 link.exe 时出错

来源:百度知道 编辑:UC知道 时间:2024/05/30 22:49:26
结果:
Output Window
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/Console.exe : fatal error LNK1120: 2 unresolved externals
执行 link.exe 时出错.

Results
Console.exe - 1 error(s), 0 warning(s)

源程序:
#include<afxcoll.h>

class CDrawBox:public CObject
{
public:
void DoDraw(char *string);
};

void CDrawBox::DoDraw(char*cValue)
{
int iCount;
int iSpace;
fprintf(stdout,"\311");
for(iCount=1;iCount<=78;iCount++)
{
fprintf(stdout,"\315");
}
fprintf(stdout,"\273");
iSpace=(80-strlen(cValue))/2;
fprintf(stdout,"\272");
for(iCount=1;iCount<=iSpace;iCount++)
{
fprintf(stdout," ");
}
fprintf(st

如果是Link的问题,那与你的源程序无关。一般和你的存放路径有关,有可能你存放的文件夹下有两个冲突的文件,比如:a1.cpp a2.cpp,此时就要把a2.cpp及其相关所有文件都删了,debug里的也得删,然后,关了VC++在重新打开就行了。

alt+O把自己存放目录给该了有的C程序设置的目录跟所要执行的目录不一样就算把程序写对了也不能运行.

你用多线程了检查一下
project-〉c/c++ code code geration 中 run time library中的 是不是选择了mulitythreated