【发布时间】:2013-03-10 19:41:55
【问题描述】:
我需要在安装了 MicGW GCC 和 G++ 4.7 的 Windows 8 中编译 C/C++ pthread 和套接字代码。
当我使用g++ test.cpp -o test编译我的测试代码时
代码是:
#include<iostream>
#include<sys/socket.h>
#include<sys/types.h>
using namespace std;
int main() {
cout<<"Got Socket";
}
这会产生错误fatal error: sys/socket.h not found 和
types.h 也一样
我发现的错误是 cygwin 使用的是 MicGW GCC 和 g++,但我希望它使用自己的而不是 MinGW 的,以便我可以包含 Linux 库。
【问题讨论】:
标签: linux gcc g++ cygwin mingw