Mingw-x64 中的类型错误
type errors in Mingw-x64
我正在尝试在 windows 上构建我的项目 (wpilib),来自 linux,它运行良好。我安装了 mingw,但它似乎没有我正在使用的所有线程的东西,所以我删除了它并安装了 mingw-x64。这让我更进一步,但现在我被困在这里。
In file included from C:/Program Files/mingw-w64/x86_64-5.1.0-posix-seh-rt_v4-rev0/mingw64/x86_64-w64-mingw32/include/winsock2.h:55:0,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/socket_types.hpp:38,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/win_tss_ptr.hpp:23,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/tss_ptr.hpp:25,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/call_stack.hpp:20,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/impl/handler_alloc_hook.ipp:19,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/handler_alloc_hook.hpp:80,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/handler_alloc_helpers.hpp:21,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/bind_handler.hpp:19,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/wrapped_handler.hpp:18,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/io_service.hpp:24,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/basic_io_object.hpp:19,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/basic_socket.hpp:20,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/basic_datagram_socket.hpp:20,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio.hpp:21,
from C:\Users\peter\gz-ws\gazebo\build\install\Debug\include\gazebo-6.0/gazebo/transport/Connection.hh:23,
from C:\Users\peter\gz-ws\gazebo\build\install\Debug\include\gazebo-6.0/gazebo/transport/transport.hh:3,
from C:\Users\peter\wpilib\cpp\current\sim\include/DriverStation.h:9,
from C:\Users\peter\wpilib\cpp\current\sim\include/RobotBase.h:9,
from C:\Users\peter\wpilib\cpp\current\sim\include/WPILib.h:35,
from ..\src\OI.h:11,
from ..\src\OI.cpp:8: C:/Program Files/mingw-w64/x86_64-5.1.0-posix-seh-rt_v4-rev0/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h:11:9: error: 'UINT_PTR' does not name a type typedef UINT_PTR SOCKET;
出于某种原因,将以下内容添加到我的所有 .cpp 文件中似乎已经解决了该特定问题。我注意到每个人似乎都把它放在最前面,但我没有看到它和 UINT_PTR
之间的联系,它在 basetsd.h
中定义
#ifdef _WIN32
// Ensure that Winsock2.h is included before Windows.h
#include <Winsock2.h>
#endif
如果有人知道为什么会修复它,我很想知道
我正在尝试在 windows 上构建我的项目 (wpilib),来自 linux,它运行良好。我安装了 mingw,但它似乎没有我正在使用的所有线程的东西,所以我删除了它并安装了 mingw-x64。这让我更进一步,但现在我被困在这里。
In file included from C:/Program Files/mingw-w64/x86_64-5.1.0-posix-seh-rt_v4-rev0/mingw64/x86_64-w64-mingw32/include/winsock2.h:55:0,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/socket_types.hpp:38,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/win_tss_ptr.hpp:23,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/tss_ptr.hpp:25,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/call_stack.hpp:20,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/impl/handler_alloc_hook.ipp:19,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/handler_alloc_hook.hpp:80,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/handler_alloc_helpers.hpp:21,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/bind_handler.hpp:19,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/detail/wrapped_handler.hpp:18,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/io_service.hpp:24,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/basic_io_object.hpp:19,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/basic_socket.hpp:20,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio/basic_datagram_socket.hpp:20,
from C:\Users\peter\gz-ws\boost_1_56_0/boost/asio.hpp:21,
from C:\Users\peter\gz-ws\gazebo\build\install\Debug\include\gazebo-6.0/gazebo/transport/Connection.hh:23,
from C:\Users\peter\gz-ws\gazebo\build\install\Debug\include\gazebo-6.0/gazebo/transport/transport.hh:3,
from C:\Users\peter\wpilib\cpp\current\sim\include/DriverStation.h:9,
from C:\Users\peter\wpilib\cpp\current\sim\include/RobotBase.h:9,
from C:\Users\peter\wpilib\cpp\current\sim\include/WPILib.h:35,
from ..\src\OI.h:11,
from ..\src\OI.cpp:8: C:/Program Files/mingw-w64/x86_64-5.1.0-posix-seh-rt_v4-rev0/mingw64/x86_64-w64-mingw32/include/psdk_inc/_socket_types.h:11:9: error: 'UINT_PTR' does not name a type typedef UINT_PTR SOCKET;
出于某种原因,将以下内容添加到我的所有 .cpp 文件中似乎已经解决了该特定问题。我注意到每个人似乎都把它放在最前面,但我没有看到它和 UINT_PTR
之间的联系,它在 basetsd.h
#ifdef _WIN32
// Ensure that Winsock2.h is included before Windows.h
#include <Winsock2.h>
#endif
如果有人知道为什么会修复它,我很想知道