程序是用C++写的,但是我没有用CSocket,想直接调用socket API,结果出了下面的错误:
Compiling...
tyIPDlg.cpp
Linking...
ty.obj : error LNK2001: unresolved external symbol __imp__socket@12
Debug/ty.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...ty.exe - 2 error(s), 0 warning(s)
为什么?
Compiling...
tyIPDlg.cpp
Linking...
ty.obj : error LNK2001: unresolved external symbol __imp__socket@12
Debug/ty.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...ty.exe - 2 error(s), 0 warning(s)
为什么?
BOOL CTyApp::OnInitNet()
{
RemoteAddress.sin_family=AF_INET;
memset(&RemoteAddress.sin_zero,0,8);
MySock=socket(AF_INET,SOCK_DGRAM,0);//????
}
Compiling...
ty.cpp
D:\Program Files\Microsoft Visual Studio\MyProjects\ty\ty.cpp(10) : fatal error C1021: invalid preprocessor command 'pramga'
Error executing cl.exe.
Creating browse info file...
BSCMAKE: error BK1506 : cannot open file '.\Debug\ty.sbr': No such file or directory
Error executing bscmake.exe.ty.exe - 2 error(s), 0 warning(s)
可是我还是不知道为什么,谁给我讲讲?