Dobrý den,
poraďte prosím, proč mi tento kód:
#include "stdafx.h"
#include <WinSock2.h>
#include <WinSock.h>
#include <WS2tcpip.h>
#include <Windows.h>
#include <iostream>
using namespace std;
int main(void)
{
WSADATA data;
WSAStartup(MAKEWORD(2,2),&data);
SOCKET soc;
soc=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
WSACleanup();
cin.get();
return 0;
}
hlásí tyto chyby:
Error 4 error LNK1120: 3 unresolved externals C:\Users\ADMIN\Documents\Visual Studio 2010\Projects\Testx\Debug\Testx.exe 1
Error 2 error LNK2019: unresolved external symbol _socket@12 referenced in function _main C:\Users\ADMIN\Documents\Visual Studio 2010\Projects\Testx\Testx\Testx.obj
Error 1 error LNK2019: unresolved external symbol _WSACleanup@0 referenced in function _main C:\Users\ADMIN\Documents\Visual Studio 2010\Projects\Testx\Testx\Testx.obj
Error 3 error LNK2019: unresolved external symbol _WSAStartup@8 referenced in function _main C:\Users\ADMIN\Documents\Visual Studio 2010\Projects\Testx\Testx\Testx.obj
Postupuju podle c/c++ hotová řešení (aspoň se o t osnažim), takže by to mělo fungovat. Používám vidual c++.
Děkuji.