我試圖端口的TCP應用程序(特別是tcpsockets),然而即時得到這個錯誤:如何在Windows和MinGW上使用'fcntl'?
error: 'fcntl' was not declared in this scope
我已經寫了這包括
#ifdef WIN32
#define _WIN32_WINNT 0x0600 //enable
#include <Ws2tcpip.h>
#pragma comment(lib, "ws2_32.lib")
typedef int socklen_t;
void close(int socket){closesocket(socket);}
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#endif
這解決了參考的大部分,但是fcntl
未找到。 我如何找到適當的參考?或者是否有另一種窗口方法可以替代它?
也許你可以告訴我們fcntl被用於什麼,所以我們可以幫助弄清楚什麼是等效的窗口。 –