我已经设置了一个Visual Studio Code环境来编写C ++程序。我目前正在编写UDP流,客户端和服务器,这要求我使用inet_ntop和inet_pton函数。但是,无论我添加到c_cpp_properties.json文件中什么,我都无法从这些功能中消失红色的波浪线。其他所有东西都可以正常工作,甚至可以编译-我从命令行使用以下命令进行编译:
cmake -G "Visual Studio 14 2015 Win64" ..
cmake --build . --config Release
这是我的c_cpp_properties.json文件的内容:
{
"configurations": [
{
"name": "MinGW",
"intelliSenseMode": "msvc-x64",
"includePath": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++/mingw32",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++/backward",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/objc/c++/tr1",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/objc/c++",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/objc/c++/mingw32",
"C:/code/Libraries/opencv-3.4.1/opencv-3.4.1/build/include",
"C:/code/Libraries/opencv-3.4.1/opencv-3.4.1/build/install/x64/vc14/lib",
"C:/code/Libraries/opencv-3.4.1/opencv-3.4.1/build/install/x64/vc14/bin",
"C:/code/Libraries/opencv-3.4.1/opencv-3.4.1/build/install",
"C:/code/Libraries/opencv-3.4.1/opencv-3.4.1/build/install/include",
"${workspaceFolder}/include"
],
"defines": [
"_DEBUG",
"UNICODE",
"__GNUC__=6",
"__cdecl=__attribute__((__cdecl__))"
],
"browse": {
"path": [
"C:/MinGW/lib/gcc/mingw32/6.3.0/include",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include-fixed",
"C:/MinGW/include/*",
"C:/code/Libraries/opencv-3.4.1/opencv-3.4.1/build/include",
"C:/code/Libraries/opencv-3.4.1/opencv-3.4.1/build/install",
"C:/code/Libraries/opencv-3.4.1/opencv-3.4.1/build/install/x64/vc14/lib",
"C:/code/Libraries/opencv-3.4.1/opencv-3.4.1/build/install/x64/vc14/bin",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}
这与我使用MinGW进行智能感知并使用Visual Studio编译器进行编译有关吗?