ensenso / ros_driver

Official ROS driver for Ensenso stereo cameras.
http://wiki.ros.org/ensenso_driver
BSD 3-Clause "New" or "Revised" License
29 stars 25 forks source link

WIP: Made the library compile on windows with Visual Studio #38

Closed jornb closed 4 years ago

jornb commented 4 years ago

Fixed several build errors when compiling with MSVC on Windows.

I've tested this, and both the node and nodelets are working after building them with MSVC 2017 Professional on Windows 10.

Note: I'm not sure if this is the best way to fix these issues, but I'm simply posting this here for you to see and decide if we should continue with a preliminary windows support or not.

Changes

Remaining issues on MSVC

yguenduez commented 4 years ago

Hello jornb,

usually the custom one is taken automatically, if make_unique is not used from std namespace. The mscv compiler however takes the make_unique from std, regardless of using that std namespace or not. You cannot force the mscv compiler to take the C++11 standard, so it will take the std::make_unique.(Forcing the compiler to lower C++ standards only works from C++17 to C++14, but not to C++11, stated here)

The best approach would be to upgrade to C++14 and use the std::make_unique. As long we are running C++11 we will take your prefixing of the custom make_unique, but are going to use the std::make_unique when switching to C++14.

Best Regards Yasin