#include <iostream.h>
// #include <afxext.h>
#include <afxsock.h>void main()
{
// CAsyncSocket sock;
DWORD dwValue;
CSocket sockClient;
sockClient.Create();
CString strAddr="";
UINT nPort=1032;
sockClient.Connect(strAddr,nPort);
CSocketFile file(&sockClient);
CArchive arIn(&file,CArchive::load);
CArchive arOut(&file,CArchive::store);
arOut<<dwValue;
arIn>>dwValue;
}
ws2_32.lib也在project-》settings中设置了,可是仍然有错误,
错误如下:
--------------------Configuration: net_002_receive - Win32 Debug--------------------
Linking...
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/net_002_receive.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.net_002_receive.exe - 3 error(s), 0 warning(s)
请问究竟是为什么?
谢谢!
结果还是出错,跟以前的错误一样;看了看错误提示,似乎真的是用到了多线程。可是,我该如何解决这个问题呢?
谢谢大家了!
在prioject-》settings》c、c++的category里面选择codegeneration,之后选择debug multithreaded dll就可以了。谢谢大家!