I'm still in the early stage of learning, and starting to write a simple HTTP application from scratch, however I was unsuccessful so far with the winsock and couldn't make it work.
What is the method to write a HTTP application, is using winsock a correct way to write HTTP application in Windows operating system environment?
I tried to merge includes from the mingw project to make winsock2 work, I really do not like the idea of merging something from fourth party.
I'd like to work directly with the Windows Operating system as intended instead of using some heavyweight precompiled files from such non-native project as mingw.
Initializing WinSock using Tiny C Compiler
By running Initialization of WinSock I'm getting an error
C:\Users\GCC Build\Desktop\Naujas aplankas\tcc>tcc initialize-winsock.c
initialize-winsock.c:6: error: include file 'winsock2.h' not found
initialize-winsock.c
/*
Initialise Winsock
*/
#include<stdio.h>
#include<winsock2.h>
#pragma comment(lib,"ws2_32.lib") //Winsock Library
int main(int argc , char *argv[])
{
WSADATA wsa;
printf("\nInitialising Winsock...");
if (WSAStartup(MAKEWORD(2,2),&wsa) != 0)
{
printf("Failed. Error Code : %d",WSAGetLastError());
return 1;
}
printf("Initialised.");
return 0;
}