#include <afxtempl.h>
#include <afxwin.h>
#include <iostream>
using namespace std;
void main(){
CArray<CPoint,CPoint> myArray;
CPoint pt;// Add elements to the array.
for (int i=0;i < 10;i++)
myArray.Add( CPoint(i, 2*i) );// Modify all the points in the array.
for (i=0;i <= myArray.GetUpperBound();i++)
{
pt = myArray.GetAt(i);
pt.x = 0;
myArray.SetAt(i, pt);
}
}
上面是我的小程序,编译通过但是build不了:
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/he.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Creating browse info file...he.exe - 3 error(s), 0 warning(s)
#include <afxwin.h>
#include <iostream>
using namespace std;
void main(){
CArray<CPoint,CPoint> myArray;
CPoint pt;// Add elements to the array.
for (int i=0;i < 10;i++)
myArray.Add( CPoint(i, 2*i) );// Modify all the points in the array.
for (i=0;i <= myArray.GetUpperBound();i++)
{
pt = myArray.GetAt(i);
pt.x = 0;
myArray.SetAt(i, pt);
}
}
上面是我的小程序,编译通过但是build不了:
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/he.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
Creating browse info file...he.exe - 3 error(s), 0 warning(s)
在Category中选择Code Generation
再在Use run-time library中选择Debug Multithreaded或者multithreaded