我试图使用MinGW(gcc file.c -o compiled.exe)在Windows中编译此.c代码:
/***************************************************/
/* AUTHOR : LAW CHIU YUEN */
/* FILENAME : smtpr.c */
/***************************************************/
#ifdef WIN32
#include <windows.h>
#include <winsock.h>
#else
#define closesocket close
#include <unistd.h>
#include <netdb.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <sys/socket.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <arpa/inet.h>
#include <ctype.h>
//#define MYPORT 40711 // the port users will be connecting to
#define PORT 25
#define MAXBUFLEN 1024 // max buffer size
#define RELAY_NAME 255 // max length of file …Run Code Online (Sandbox Code Playgroud)