ros-industrial / abb_robot_driver

The new ROS driver for ABB robots
BSD 3-Clause "New" or "Revised" License
100 stars 42 forks source link

Windows build failing #17

Open dyumanaditya opened 3 years ago

dyumanaditya commented 3 years ago

Hi, When I try to build the package on Windows using catkin_make_isolated (because catkin build isn't supported on Windows) this is my CMakeError log:

Click to expand ``` Determining if the include file pthread.h exists failed with the following output: Change Dir: C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/CMakeTmp Run Build Command(s):C:/PROGRA~2/MICROS~2/2019/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe cmTC_d3d33 && [1/2] Building C object CMakeFiles\cmTC_d3d33.dir\CheckIncludeFile.c.obj FAILED: CMakeFiles/cmTC_d3d33.dir/CheckIncludeFile.c.obj C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe /nologo /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\cmTC_d3d33.dir\CheckIncludeFile.c.obj /FdCMakeFiles\cmTC_d3d33.dir\ /FS -c CheckIncludeFile.c CheckIncludeFile.c(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory ninja: build stopped: subcommand failed. ```

And this is my CMakeOutput log:

Click to expand ``` The system is: Windows - 10.0.19042 - AMD64 Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded. Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe Build flags: Id flags: The output was: 0 Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64 Copyright (C) Microsoft Corporation. All rights reserved. CMakeCCompilerId.c Microsoft (R) Incremental Linker Version 14.28.29337.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:CMakeCCompilerId.exe CMakeCCompilerId.obj Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.exe" Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.obj" The C compiler identification is MSVC, found in "C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/3.18.2/CompilerIdC/CMakeCCompilerId.exe" Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" succeeded. Compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe Build flags: Id flags: The output was: 0 Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29337 for x64 Copyright (C) Microsoft Corporation. All rights reserved. CMakeCXXCompilerId.cpp Microsoft (R) Incremental Linker Version 14.28.29337.0 Copyright (C) Microsoft Corporation. All rights reserved. /out:CMakeCXXCompilerId.exe CMakeCXXCompilerId.obj Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.exe" Compilation of the CXX compiler identification source "CMakeCXXCompilerId.cpp" produced "CMakeCXXCompilerId.obj" The CXX compiler identification is MSVC, found in "C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/3.18.2/CompilerIdCXX/CMakeCXXCompilerId.exe" Detecting C compiler ABI info compiled with the following output: Change Dir: C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/CMakeTmp Run Build Command(s):C:/PROGRA~2/MICROS~2/2019/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe cmTC_c4114 && [1/2] Building C object CMakeFiles\cmTC_c4114.dir\CMakeCCompilerABI.c.obj [2/2] Linking C executable cmTC_c4114.exe Detecting CXX compiler ABI info compiled with the following output: Change Dir: C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/CMakeTmp Run Build Command(s):C:/PROGRA~2/MICROS~2/2019/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe cmTC_92086 && [1/2] Building CXX object CMakeFiles\cmTC_92086.dir\CMakeCXXCompilerABI.cpp.obj [2/2] Linking CXX executable cmTC_92086.exe ```

Can this package be build on Windows? If not, what is the best way to use this package on Ubuntu and run RobotStudio on Windows?

gavanderhoorn commented 3 years ago

I'm not a windows user myself, but I know that @jontje uses the driver on Windows.

From the logs you show it appears abb_rapid_msgs is failing to configure for some reason.

Could you add a little more detail as to what your workflow is exactly?

How did you install ROS? How did you create your workspace? How do you invoke catkin_make_isolated exactly?

Please be specific, don't assume we know anything and try to refrain from describing commands you run, instead copy-paste them verbatim into your comment.

Finally: does catkin_make instead of catkin_make_isolated work?

Be sure to delete the build, devel and/or build_isolated and devel_isolated between attempts.

dyumanaditya commented 3 years ago

Thanks for the quick reply, I installed ROS Noetic on my Windows 10 system by following the instructions on the ROS page.

As advised on the installation website, I'm using the x64 Native Tools Command Prompt for VS 2019 terminal running as admin and sourced to the correct setup file in the ROS package.

I created a catkin_ws folder in my C drive under Users/(my name), and initialized the catkin_ws with catkin_init_workspace. I then followed the build instructions from this repository. I modified "melodic" to "noetic" in the 5th line, and ran catkin_make_isolated instead of catkin build (which apparently doesn't work on Windows). I tried building the package using catkin_make which failed as well.

There is nothing else inside my catkin_ws/src folder except for this package. Please let me know if you need more information about anything.

gavanderhoorn commented 3 years ago

Could you please remove everything from the src space of your workspace, git clone the ros-industrial/abb_robot_driver_interfaces repository into it and then move the abb_egm_msgs package to the root of the src space. Remove the abb_robot_driver_interfaces directory from src after that.

Also remove any build, devel and/or build_isolated and devel_isolated folders which may be present in catkin_ws.

You should have only this:

catkin_ws/
  src/
    abb_egm_msgs

then try to build that (after having sourced things, in the correct terminal, etc).

If that fails as well, this starts to look like a more general problem with your ROSonWindows configuration, and no longer something specific to the driver here (or related packages).

dyumanaditya commented 3 years ago

I followed your instructions and was able to build abb_egm_msgs without a problem using catkin_make_isolated.

What could be going wrong with the building of the abb_robot_driver package?

gavanderhoorn commented 3 years ago

What could be going wrong with the building of the abb_robot_driver package?

a step-by-step approach would likely be the easiest way to diagnose this.

Use the same procedure as in https://github.com/ros-industrial/abb_robot_driver/issues/17#issuecomment-790553337, but progressively add more packages.

At some point the build will fail again.

Then we can start to try and understand why that's happening.

And as I wrote earlier: always remove any build, devel and/or build_isolated and devel_isolated folders which may be present in catkin_ws before running another iteration.

dyumanaditya commented 3 years ago

I've narrowed down the problem to the abb_robot_driver_interfaces/abb_rapid_msgs package by iteratively adding more packages.

Here is the error from the terminal after I ran catkin_make_isolated:

Click to expand ``` ==> Processing catkin package: 'abb_rapid_msgs' ==> Creating build directory: 'build_isolated\abb_rapid_msgs' ==> Building with env: 'C:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_rws_managers\env.bat' ==> cmake C:\Users\Dyuman\catkin_ws\src\abb_rapid_msgs -DCATKIN_DEVEL_PREFIX=C:\Users\Dyuman\catkin_ws\devel_isolated\abb_rapid_msgs -DCMAKE_INSTALL_PREFIX=C:\Users\Dyuman\catkin_ws\install_isolated -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja in 'C:\Users\Dyuman\catkin_ws\build_isolated\abb_rapid_msgs' -- The C compiler identification is MSVC 19.28.29337.0 -- The CXX compiler identification is MSVC 19.28.29337.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using CATKIN_DEVEL_PREFIX: C:/Users/Dyuman/catkin_ws/devel_isolated/abb_rapid_msgs -- Using CMAKE_PREFIX_PATH: C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_rws_managers;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_librws;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_libegm;C:\opt\ros\noetic\x64\tools\vcpkg\installed\x64-windows;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_msgs;c:\opt\ros\noetic\x64 -- This workspace overlays: C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_msgs;c:/opt/ros/noetic/x64 -- Found PythonInterp: C:/opt/ros/noetic/x64/python.exe (found suitable version "3.8.3", minimum required is "3") -- Using PYTHON_EXECUTABLE: C:/opt/ros/noetic/x64/python.exe -- Using default Python package layout -- Found PY_em: C:\opt\ros\noetic\x64\lib\site-packages\em.py -- Using empy: C:/opt/ros/noetic/x64/lib/site-packages/em.py -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/test_results -- Found gtest: gtests will be built -- Using Python nosetests: C:/opt/ros/noetic/x64/Scripts/nosetests.exe -- catkin 0.8.9 -- BUILD_SHARED_LIBS is on -- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy C:/opt/ros/noetic/x64/share/genmsg/cmake/pkg-genmsg.cmake.em:56: error: : 'charmap' codec can't decode byte 0x9d in position 673: character maps to Traceback (most recent call last): File "C:/opt/ros/noetic/x64/lib/site-packages/em.py", line 3303, in if __name__ == '__main__': main() File "C:/opt/ros/noetic/x64/lib/site-packages/em.py", line 3301, in main invoke(sys.argv[1:]) File "C:/opt/ros/noetic/x64/lib/site-packages/em.py", line 3284, in invoke interpreter.wrap(interpreter.file, (file, name)) File "C:/opt/ros/noetic/x64/lib/site-packages/em.py", line 2295, in wrap self.fail(e) File "C:/opt/ros/noetic/x64/lib/site-packages/em.py", line 2284, in wrap callable(*args) File "C:/opt/ros/noetic/x64/lib/site-packages/em.py", line 2359, in file self.safe(scanner, done, locals) File "C:/opt/ros/noetic/x64/lib/site-packages/em.py", line 2401, in safe self.parse(scanner, locals) File "C:/opt/ros/noetic/x64/lib/site-packages/em.py", line 2421, in parse token.run(self, locals) File "C:/opt/ros/noetic/x64/lib/site-packages/em.py", line 1425, in run interpreter.execute(self.code, locals) File "C:/opt/ros/noetic/x64/lib/site-packages/em.py", line 2596, in execute _exec(statements, self.globals, locals) File "", line 38, in File "C:\opt\ros\noetic\x64\lib\site-packages\genmsg\deps.py", line 45, in find_msg_dependencies_with_type spec = genmsg.msg_loader.load_msg_from_file(msg_context, msg_file, full_type_name) File "C:\opt\ros\noetic\x64\lib\site-packages\genmsg\msg_loader.py", line 285, in load_msg_from_file text = f.read() File "encodings\cp1252.py", line 23, in decode UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 673: character maps to CMake Error at C:/opt/ros/noetic/x64/share/catkin/cmake/safe_execute_process.cmake:11 (message): execute_process(C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/catkin_generated/env_cached.bat "C:/opt/ros/noetic/x64/python.exe" "C:/opt/ros/noetic/x64/lib/site-packages/em.py" "--raw-errors" "-F" "C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/cmake/abb_rapid_msgs-genmsg-context.py" "-o" "C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/cmake/abb_rapid_msgs-genmsg.cmake" "C:/opt/ros/noetic/x64/share/genmsg/cmake/pkg-genmsg.cmake.em") returned error code 1 Call Stack (most recent call first): C:/opt/ros/noetic/x64/share/catkin/cmake/em_expand.cmake:25 (safe_execute_process) C:/opt/ros/noetic/x64/share/genmsg/cmake/genmsg-extras.cmake:303 (em_expand) CMakeLists.txt:57 (generate_messages) -- Configuring incomplete, errors occurred! See also "C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/CMakeOutput.log". See also "C:/Users/Dyuman/catkin_ws/build_isolated/abb_rapid_msgs/CMakeFiles/CMakeError.log". <== Failed to process package 'abb_rapid_msgs': Command '['C:\\Users\\Dyuman\\catkin_ws\\devel_isolated\\abb_egm_rws_managers\\env.bat', 'cmake', 'C:\\Users\\Dyuman\\catkin_ws\\src\\abb_rapid_msgs', '-DCATKIN_DEVEL_PREFIX=C:\\Users\\Dyuman\\catkin_ws\\devel_isolated\\abb_rapid_msgs', '-DCMAKE_INSTALL_PREFIX=C:\\Users\\Dyuman\\catkin_ws\\install_isolated', '-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-G', 'Ninja']' returned non-zero exit status 1. Reproduce this error by running: ==> cd 'C:\Users\Dyuman\catkin_ws\build_isolated\abb_rapid_msgs' && 'C:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_rws_managers\env.bat' cmake 'C:\Users\Dyuman\catkin_ws\src\abb_rapid_msgs' '-DCATKIN_DEVEL_PREFIX=C:\Users\Dyuman\catkin_ws\devel_isolated\abb_rapid_msgs' '-DCMAKE_INSTALL_PREFIX=C:\Users\Dyuman\catkin_ws\install_isolated' -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja Command failed, exiting. ```

The content of CMakeOutput.log and CMakeError.log is the same as what was posted in the first post.

Determining if the include file pthread.h exists failed with the following output:

This is the first line of the CMakeError.log, which for some reason was not copied correctly in the first post until now (edited).

gavanderhoorn commented 3 years ago

Ok.

So first: I don't think what you find in CMakeError.log is related.

I believe there is a problem with some of the characters in some of the .msg files in abb_rapid_msgs. Linux and OSX are fine with this, but Windows is a bit stricter with the codepages and can't decode the bytes to proper characters.

These two .msgs are suspicious:

the links point to the specific lines which I believe contain the potentially "offending" characters.

Could you try to remove the ° from RobTarget.msg first and see whether things build then.

If they don't, remove the from ExtJoint.msg and try again.

gavanderhoorn commented 3 years ago

@DyumanAditya: could you check whether https://github.com/ros-industrial/abb_robot_driver_interfaces/pull/9 solves your build issues?

Or at least this build issue?

dyumanaditya commented 3 years ago

Both changes were necessary for the abb_robot_driver_interfaces/abb_rapid_msgs package to build successfully.

After fixing this, the build failed further down the line: in the abb_robot_driver/abb_egm_hardware_interface package.

This is the error in the terminal after running catkin_make_isolated:

Click to expand ``` ==> Processing catkin package: 'abb_egm_hardware_interface' ==> Creating build directory: 'build_isolated\abb_egm_hardware_interface' ==> Building with env: 'C:\Users\Dyuman\catkin_ws\devel_isolated\abb_robot_cpp_utilities\env.bat' ==> cmake C:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_egm_hardware_interface -DCATKIN_DEVEL_PREFIX=C:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_hardware_interface -DCMAKE_INSTALL_PREFIX=C:\Users\Dyuman\catkin_ws\install_isolated -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja in 'C:\Users\Dyuman\catkin_ws\build_isolated\abb_egm_hardware_interface' -- The CXX compiler identification is MSVC 19.28.29337.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for C++ include pthread.h -- Looking for C++ include pthread.h - not found -- Found Threads: TRUE -- Found Boost: C:/opt/ros/noetic/x64/include (found version "1.73.0") found components: regex system thread chrono date_time atomic -- Searching for Poco library... -- Found Poco! -- components found: Foundation, Net, Util, XML. -- Found Protobuf: C:/opt/ros/noetic/x64/Lib/libprotobuf.lib (found version "3.12.3") -- Using CATKIN_DEVEL_PREFIX: C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_hardware_interface -- Using CMAKE_PREFIX_PATH: C:\opt\ros\noetic\x64\tools\vcpkg\installed\x64-windows;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_cpp_utilities;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_bringup_examples;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_rapid_sm_addin_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_rapid_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_rws_managers;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_librws;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_libegm;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_msgs;c:\opt\ros\noetic\x64 -- This workspace overlays: C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_cpp_utilities;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_bringup_examples;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_rapid_sm_addin_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_rapid_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_msgs;c:/opt/ros/noetic/x64 -- Found PythonInterp: C:/opt/ros/noetic/x64/python.exe (found suitable version "3.8.3", minimum required is "3") -- Using PYTHON_EXECUTABLE: C:/opt/ros/noetic/x64/python.exe -- Using default Python package layout -- Found PY_em: C:\opt\ros\noetic\x64\lib\site-packages\em.py -- Using empy: C:/opt/ros/noetic/x64/lib/site-packages/em.py -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: C:/Users/Dyuman/catkin_ws/build_isolated/abb_egm_hardware_interface/test_results -- Found gtest: gtests will be built -- Using Python nosetests: C:/opt/ros/noetic/x64/Scripts/nosetests.exe -- catkin 0.8.9 -- BUILD_SHARED_LIBS is on -- Configuring done -- Generating done -- Build files have been written to: C:/Users/Dyuman/catkin_ws/build_isolated/abb_egm_hardware_interface ==> ninja -j8 -l8 in 'C:\Users\Dyuman\catkin_ws\build_isolated\abb_egm_hardware_interface' [3/10] Building CXX object CMakeFiles\abb_egm_hardware_interface_controller_stopper_exe.dir\src\egm_controller_stopper_main.cpp.obj cl : Command line warning D9025 : overriding '/W3' with '/W4' C:\opt\ros\noetic\x64\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. [4/10] Building CXX object CMakeFiles\abb_egm_hardware_interface_hardware_interface.dir\src\egm_hardware_interface.cpp.obj FAILED: CMakeFiles/abb_egm_hardware_interface_hardware_interface.dir/src/egm_hardware_interface.cpp.obj C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -DPROTOBUF_USE_DLLS -DROSCONSOLE_BACKEND_LOG4CXX -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"abb_egm_hardware_interface\" -DWIN32_LEAN_AND_MEAN -D_USE_MATH_DEFINES -Dabb_egm_hardware_interface_hardware_interface_EXPORTS -IC:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_egm_hardware_interface\include -IC:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_robot_cpp_utilities\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_robot_msgs\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_rapid_sm_addin_msgs\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_rapid_msgs\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_msgs\include -IC:\opt\ros\noetic\x64\share\xmlrpcpp\cmake\..\..\..\include\xmlrpcpp -IC:\opt\ros\noetic\x64\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_rws_managers\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_libegm\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_librws\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Zi /O2 /Ob1 /DNDEBUG /D _VARIADIC_MAX=10 /Zc:__cplusplus /W4 /FIC:/Users/Dyuman/catkin_ws/build_isolated/abb_egm_rws_managers/devel/abb_egm_rws_managers_export.h /FIC:/Users/Dyuman/catkin_ws/build_isolated/abb_libegm/devel/abb_libegm_export.h /showIncludes /FoCMakeFiles\abb_egm_hardware_interface_hardware_interface.dir\src\egm_hardware_interface.cpp.obj /FdCMakeFiles\abb_egm_hardware_interface_hardware_interface.dir\ /FS -c C:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_egm_hardware_interface\src\egm_hardware_interface.cpp cl : Command line warning D9025 : overriding '/W3' with '/W4' C:\opt\ros\noetic\x64\include\google/protobuf/stubs/mutex.h(107): warning C4251: 'google::protobuf::internal::WrappedMutex::mu_': class 'std::mutex' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::WrappedMutex' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\mutex(87): note: see declaration of 'std::mutex' C:\opt\ros\noetic\x64\include\google/protobuf/descriptor.h(1960): warning C4251: 'google::protobuf::DescriptorPool::tables_': class 'std::unique_ptr>' needs to have dll-interface to be used by clients of class 'google::protobuf::DescriptorPool' C:\opt\ros\noetic\x64\include\google/protobuf/descriptor.h(1960): note: see declaration of 'std::unique_ptr>' C:\opt\ros\noetic\x64\include\google/protobuf/descriptor.h(1970): warning C4251: 'google::protobuf::DescriptorPool::unused_import_track_files_': class 'std::map,std::allocator>>' needs to have dll-interface to be used by clients of class 'google::protobuf::DescriptorPool' C:\opt\ros\noetic\x64\include\google/protobuf/descriptor.h(1970): note: see declaration of 'std::map,std::allocator>>' C:\opt\ros\noetic\x64\include\google/protobuf/stubs/logging.h(102): warning C4251: 'google::protobuf::internal::LogMessage::message_': class 'std::basic_string,std::allocator>' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::LogMessage' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring(4648): note: see declaration of 'std::basic_string,std::allocator>' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(289): warning C4251: 'google::protobuf::internal::ArenaImpl::lifecycle_id_generator_': struct 'std::atomic<__int64>' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ArenaImpl' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\atomic(2770): note: see declaration of 'std::atomic<__int64>' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(323): warning C4251: 'google::protobuf::internal::ArenaImpl::threads_': struct 'std::atomic' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ArenaImpl' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(322): note: see declaration of 'std::atomic' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(324): warning C4251: 'google::protobuf::internal::ArenaImpl::hint_': struct 'std::atomic' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ArenaImpl' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(322): note: see declaration of 'std::atomic' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(325): warning C4251: 'google::protobuf::internal::ArenaImpl::space_allocated_': struct 'std::atomic' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ArenaImpl' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\atomic(2771): note: see declaration of 'std::atomic' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(362): warning C4251: 'google::protobuf::internal::ArenaImpl::options_': struct 'google::protobuf::internal::ArenaImpl::Options' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ArenaImpl' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(68): note: see declaration of 'google::protobuf::internal::ArenaImpl::Options' C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(358): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(365): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/io/coded_stream.h(1250): warning C4251: 'google::protobuf::io::CodedOutputStream::default_serialization_deterministic_': struct 'std::atomic' needs to have dll-interface to be used by clients of class 'google::protobuf::io::CodedOutputStream' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\atomic(2759): note: see declaration of 'std::atomic' C:\opt\ros\noetic\x64\include\google/protobuf/metadata_lite.h(239): warning C4251: 'google::protobuf::internal::LiteUnknownFieldSetter::buffer_': class 'std::basic_string,std::allocator>' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::LiteUnknownFieldSetter' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring(4648): note: see declaration of 'std::basic_string,std::allocator>' C:\opt\ros\noetic\x64\include\google/protobuf/message_lite.h(467): warning C4251: 'google::protobuf::MessageLite::_internal_metadata_': class 'google::protobuf::internal::InternalMetadata' needs to have dll-interface to be used by clients of class 'google::protobuf::MessageLite' C:\opt\ros\noetic\x64\include\google/protobuf/metadata_lite.h(59): note: see declaration of 'google::protobuf::internal::InternalMetadata' C:\opt\ros\noetic\x64\include\google/protobuf/implicit_weak_message.h(94): warning C4251: 'google::protobuf::internal::ImplicitWeakMessage::data_': class 'std::basic_string,std::allocator>' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ImplicitWeakMessage' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring(4648): note: see declaration of 'std::basic_string,std::allocator>' C:\opt\ros\noetic\x64\include\google/protobuf/io/zero_copy_stream_impl_lite.h(243): warning C4251: 'google::protobuf::io::CopyingInputStreamAdaptor::buffer_': class 'std::unique_ptr>' needs to have dll-interface to be used by clients of class 'google::protobuf::io::CopyingInputStreamAdaptor' C:\opt\ros\noetic\x64\include\google/protobuf/io/zero_copy_stream_impl_lite.h(243): note: see declaration of 'std::unique_ptr>' C:\opt\ros\noetic\x64\include\google/protobuf/io/zero_copy_stream_impl_lite.h(332): warning C4251: 'google::protobuf::io::CopyingOutputStreamAdaptor::buffer_': class 'std::unique_ptr>' needs to have dll-interface to be used by clients of class 'google::protobuf::io::CopyingOutputStreamAdaptor' C:\opt\ros\noetic\x64\include\google/protobuf/io/zero_copy_stream_impl_lite.h(243): note: see declaration of 'std::unique_ptr>' C:\opt\ros\noetic\x64\include\google/protobuf/unknown_field_set.h(206): warning C4251: 'google::protobuf::UnknownFieldSet::fields_': class 'std::vector>' needs to have dll-interface to be used by clients of class 'google::protobuf::UnknownFieldSet' C:\opt\ros\noetic\x64\include\google/protobuf/unknown_field_set.h(206): note: see declaration of 'std::vector>' C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(215): warning C4100: 'field': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(219): warning C4100: 'descriptor': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/message.h(1029): warning C4100: 'message': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(427): warning C4251: 'google::protobuf::TextFormat::Printer::default_field_value_printer_': class 'std::unique_ptr>' needs to have dll-interface to be used by clients of class 'google::protobuf::TextFormat::Printer' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(427): note: see declaration of 'std::unique_ptr>' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(431): warning C4251: 'google::protobuf::TextFormat::Printer::custom_printers_': class 'std::map>,std::less,std::allocator>>>>' needs to have dll-interface to be used by clients of class 'google::protobuf::TextFormat::Printer' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(428): note: see declaration of 'std::map>,std::less,std::allocator>>>>' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(435): warning C4251: 'google::protobuf::TextFormat::Printer::custom_message_printers_': class 'std::map>,std::less,std::allocator>>>>' needs to have dll-interface to be used by clients of class 'google::protobuf::TextFormat::Printer' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(433): note: see declaration of 'std::map>,std::less,std::allocator>>>>' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(521): warning C4251: 'google::protobuf::TextFormat::ParseInfoTree::locations_': class 'std::map>,std::less,std::allocator>>>>' needs to have dll-interface to be used by clients of class 'google::protobuf::TextFormat::ParseInfoTree' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(512): note: see declaration of 'std::map>,std::less,std::allocator>>>>' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(522): warning C4251: 'google::protobuf::TextFormat::ParseInfoTree::nested_': class 'std::map>,std::allocator>>>,std::less,std::allocator>,std::allocator>>>>>>' needs to have dll-interface to be used by clients of class 'google::protobuf::TextFormat::ParseInfoTree' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(517): note: see declaration of 'std::map>,std::allocator>>>,std::less,std::allocator>,std::allocator>>>>>>' C:\opt\ros\noetic\x64\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example: - add -D_WIN32_WINNT=0x0601 to the compiler command line; or - add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions. Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target). C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(171): error C2143: syntax error: missing '}' before 'constant' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(171): error C2059: syntax error: 'constant' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(172): error C2143: syntax error: missing ';' before '}' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(172): error C2238: unexpected token(s) preceding ';' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): error C2433: 'SwitchState': 'virtual' not permitted on data declarations C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): error C2146: syntax error: missing ';' before identifier 'switchResult' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(176): error C2270: 'switchResult': modifiers not allowed on nonmember functions C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(176): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(177): error C2825: 'hardware_interface::SwitchState': must be a class or namespace when followed by '::' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(177): error C2510: 'SwitchState': left of '::' must be a class/struct/union C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(177): error C2065: 'DONE': undeclared identifier C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C2433: 'SwitchState': 'virtual' not permitted on data declarations C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C2086: 'int hardware_interface::SwitchState': redefinition C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): note: see declaration of 'hardware_interface::SwitchState' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C2146: syntax error: missing ';' before identifier 'switchResult' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(182): error C2270: 'switchResult': modifiers not allowed on nonmember functions C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(182): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(183): error C2825: 'hardware_interface::SwitchState': must be a class or namespace when followed by '::' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(183): error C2510: 'SwitchState': left of '::' must be a class/struct/union C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(183): error C2065: 'DONE': undeclared identifier C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(206): error C2575: 'read': only member functions and bases can be virtual C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(224): error C2575: 'write': only member functions and bases can be virtual C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(229): error C2065: 'RobotHW': undeclared identifier C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(229): error C2923: 'std::shared_ptr': 'RobotHW' is not a valid template type argument for parameter '_Ty' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(231): error C2059: syntax error: '}' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(231): error C2143: syntax error: missing ';' before '}' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\assert.h(14): error C2143: syntax error: missing ';' before '{' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\assert.h(14): error C2447: '{': missing function header (old-style formal list?) [5/10] Building CXX object CMakeFiles\abb_egm_hardware_interface_controller_stopper.dir\src\egm_controller_stopper.cpp.obj cl : Command line warning D9025 : overriding '/W3' with '/W4' C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(358): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(365): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(215): warning C4100: 'field': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(219): warning C4100: 'descriptor': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/message.h(1029): warning C4100: 'message': unreferenced formal parameter C:\Users\Dyuman\catkin_ws\devel_isolated\abb_librws\include\abb_librws\rws_poco_client.h(424): warning C4244: 'initializing': conversion from 'double' to 'const Poco::Int64', possible loss of data C:\Users\Dyuman\catkin_ws\devel_isolated\abb_librws\include\abb_librws\rws_client.h(836): warning C4244: 'initializing': conversion from 'double' to 'const Poco::Int64', possible loss of data C:\opt\ros\noetic\x64\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. C:\opt\ros\noetic\x64\include\ros/message_event.h(217): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\ros/message_event.h(160): note: see reference to function template instantiation 'boost::shared_ptr ros::MessageEvent>>::copyMessageIfNecessary(void) const' being compiled with [ M=const abb_egm_msgs::EGMState_> ] C:\opt\ros\noetic\x64\include\ros/message_event.h(160): note: see reference to function template instantiation 'boost::shared_ptr ros::MessageEvent>>::copyMessageIfNecessary(void) const' being compiled with [ M=const abb_egm_msgs::EGMState_> ] C:\opt\ros\noetic\x64\include\ros/message_event.h(159): note: while compiling class template member function 'boost::shared_ptr ros::MessageEvent>>::getMessage(void) const' C:\opt\ros\noetic\x64\include\ros/parameter_adapter.h(92): note: see reference to function template instantiation 'boost::shared_ptr ros::MessageEvent>>::getMessage(void) const' being compiled C:\opt\ros\noetic\x64\include\ros/subscription_callback_helper.h(143): note: see reference to class template instantiation 'ros::MessageEvent>>' being compiled C:\opt\ros\noetic\x64\include\ros/subscription_callback_helper.h(142): note: while compiling class template member function 'void ros::SubscriptionCallbackHelperT &,void>::call(ros::SubscriptionCallbackHelperCallParams &)' C:\opt\ros\noetic\x64\include\boost/smart_ptr/detail/sp_convertible.hpp(49): note: see reference to class template instantiation 'ros::SubscriptionCallbackHelperT &,void>' being compiled C:\opt\ros\noetic\x64\include\boost/smart_ptr/detail/sp_convertible.hpp(82): note: see reference to class template instantiation 'boost::detail::sp_convertible' being compiled with [ Y=ros::SubscriptionCallbackHelperT &,void>, T=ros::SubscriptionCallbackHelper ] C:\opt\ros\noetic\x64\include\ros/subscribe_options.h(112): note: see reference to class template instantiation 'boost::detail::sp_enable_if_convertible &,void>,T>' being compiled with [ T=ros::SubscriptionCallbackHelper ] C:\opt\ros\noetic\x64\include\boost/smart_ptr/shared_ptr.hpp(643): note: while compiling class template member function 'boost::shared_ptr::shared_ptr(boost::shared_ptr &&,boost::detail::sp_enable_if_convertible::type) noexcept' with [ T=ros::SubscriptionCallbackHelper ] C:\opt\ros\noetic\x64\include\ros/node_handle.h(470): note: see reference to function template instantiation 'void ros::SubscribeOptions::init(const std::string &,uint32_t,const boost::function &)> &,const boost::function (void)> &)' being compiled with [ M=abb_egm_msgs::EGMState ] C:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_egm_hardware_interface\src\egm_controller_stopper.cpp(95): note: see reference to function template instantiation 'ros::Subscriber ros::NodeHandle::subscribe(const std::string &,uint32_t,void (__cdecl abb::robot::EGMControllerStopper::* )(const boost::shared_ptr &),T *,const ros::TransportHints &)' being compiled with [ T=abb::robot::EGMControllerStopper ] [6/10] Building CXX object CMakeFiles\abb_egm_hardware_interface_hardware_interface_exe.dir\src\egm_hardware_interface_main.cpp.obj cl : Command line warning D9025 : overriding '/W3' with '/W4' C:\opt\ros\noetic\x64\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. C:\opt\ros\noetic\x64\include\controller_manager/controller_spec.h(33): warning C4068: unknown pragma 'GCC' C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(358): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(365): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(215): warning C4100: 'field': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(219): warning C4100: 'descriptor': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/message.h(1029): warning C4100: 'message': unreferenced formal parameter Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example: - add -D_WIN32_WINNT=0x0601 to the compiler command line; or - add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions. Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target). ninja: build stopped: subcommand failed. <== Failed to process package 'abb_egm_hardware_interface': Command '['C:\\Users\\Dyuman\\catkin_ws\\devel_isolated\\abb_robot_cpp_utilities\\env.bat', 'ninja', '-j8', '-l8']' returned non-zero exit status 1. Reproduce this error by running: ==> cd 'C:\Users\Dyuman\catkin_ws\build_isolated\abb_egm_hardware_interface' && 'C:\Users\Dyuman\catkin_ws\devel_isolated\abb_robot_cpp_utilities\env.bat' ninja -j8 -l8 Command failed, exiting. ```

After running cd C:\Users\Dyuman\catkin_ws\build_isolated\abb_egm_hardware_interface and then C:\Users\Dyuman\catkin_ws\devel_isolated\abb_robot_cpp_utilities\env.bat ninja -j8 -l8 to reproduce this error, this is the output message in the terminal:

Click to expand ``` [1/5] Linking CXX shared library C:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_hardware_interface\bin\abb_egm_hardware_interface_controller_stopper.dll Creating library C:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_hardware_interface\lib\abb_egm_hardware_interface_controller_stopper.lib and object C:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_hardware_interface\lib\abb_egm_hardware_interface_controller_stopper.exp Creating library C:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_hardware_interface\lib\abb_egm_hardware_interface_controller_stopper.lib and object C:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_hardware_interface\lib\abb_egm_hardware_interface_controller_stopper.exp [3/5] Building CXX object CMakeFiles\abb_egm_hardware_interface_hardware_interface.dir\src\egm_hardware_interface.cpp.obj FAILED: CMakeFiles/abb_egm_hardware_interface_hardware_interface.dir/src/egm_hardware_interface.cpp.obj C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -DPROTOBUF_USE_DLLS -DROSCONSOLE_BACKEND_LOG4CXX -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"abb_egm_hardware_interface\" -DWIN32_LEAN_AND_MEAN -D_USE_MATH_DEFINES -Dabb_egm_hardware_interface_hardware_interface_EXPORTS -IC:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_egm_hardware_interface\include -IC:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_robot_cpp_utilities\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_robot_msgs\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_rapid_sm_addin_msgs\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_rapid_msgs\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_msgs\include -IC:\opt\ros\noetic\x64\share\xmlrpcpp\cmake\..\..\..\include\xmlrpcpp -IC:\opt\ros\noetic\x64\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_rws_managers\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_libegm\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_librws\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Zi /O2 /Ob1 /DNDEBUG /D _VARIADIC_MAX=10 /Zc:__cplusplus /W4 /FIC:/Users/Dyuman/catkin_ws/build_isolated/abb_egm_rws_managers/devel/abb_egm_rws_managers_export.h /FIC:/Users/Dyuman/catkin_ws/build_isolated/abb_libegm/devel/abb_libegm_export.h /showIncludes /FoCMakeFiles\abb_egm_hardware_interface_hardware_interface.dir\src\egm_hardware_interface.cpp.obj /FdCMakeFiles\abb_egm_hardware_interface_hardware_interface.dir\ /FS -c C:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_egm_hardware_interface\src\egm_hardware_interface.cpp cl : Command line warning D9025 : overriding '/W3' with '/W4' C:\opt\ros\noetic\x64\include\google/protobuf/stubs/mutex.h(107): warning C4251: 'google::protobuf::internal::WrappedMutex::mu_': class 'std::mutex' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::WrappedMutex' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\mutex(87): note: see declaration of 'std::mutex' C:\opt\ros\noetic\x64\include\google/protobuf/descriptor.h(1960): warning C4251: 'google::protobuf::DescriptorPool::tables_': class 'std::unique_ptr>' needs to have dll-interface to be used by clients of class 'google::protobuf::DescriptorPool' C:\opt\ros\noetic\x64\include\google/protobuf/descriptor.h(1960): note: see declaration of 'std::unique_ptr>' C:\opt\ros\noetic\x64\include\google/protobuf/descriptor.h(1970): warning C4251: 'google::protobuf::DescriptorPool::unused_import_track_files_': class 'std::map,std::allocator>>' needs to have dll-interface to be used by clients of class 'google::protobuf::DescriptorPool' C:\opt\ros\noetic\x64\include\google/protobuf/descriptor.h(1970): note: see declaration of 'std::map,std::allocator>>' C:\opt\ros\noetic\x64\include\google/protobuf/stubs/logging.h(102): warning C4251: 'google::protobuf::internal::LogMessage::message_': class 'std::basic_string,std::allocator>' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::LogMessage' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring(4648): note: see declaration of 'std::basic_string,std::allocator>' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(289): warning C4251: 'google::protobuf::internal::ArenaImpl::lifecycle_id_generator_': struct 'std::atomic<__int64>' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ArenaImpl' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\atomic(2770): note: see declaration of 'std::atomic<__int64>' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(323): warning C4251: 'google::protobuf::internal::ArenaImpl::threads_': struct 'std::atomic' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ArenaImpl' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(322): note: see declaration of 'std::atomic' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(324): warning C4251: 'google::protobuf::internal::ArenaImpl::hint_': struct 'std::atomic' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ArenaImpl' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(322): note: see declaration of 'std::atomic' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(325): warning C4251: 'google::protobuf::internal::ArenaImpl::space_allocated_': struct 'std::atomic' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ArenaImpl' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\atomic(2771): note: see declaration of 'std::atomic' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(362): warning C4251: 'google::protobuf::internal::ArenaImpl::options_': struct 'google::protobuf::internal::ArenaImpl::Options' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ArenaImpl' C:\opt\ros\noetic\x64\include\google/protobuf/arena_impl.h(68): note: see declaration of 'google::protobuf::internal::ArenaImpl::Options' C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(358): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(365): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/io/coded_stream.h(1250): warning C4251: 'google::protobuf::io::CodedOutputStream::default_serialization_deterministic_': struct 'std::atomic' needs to have dll-interface to be used by clients of class 'google::protobuf::io::CodedOutputStream' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\atomic(2759): note: see declaration of 'std::atomic' C:\opt\ros\noetic\x64\include\google/protobuf/metadata_lite.h(239): warning C4251: 'google::protobuf::internal::LiteUnknownFieldSetter::buffer_': class 'std::basic_string,std::allocator>' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::LiteUnknownFieldSetter' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring(4648): note: see declaration of 'std::basic_string,std::allocator>' C:\opt\ros\noetic\x64\include\google/protobuf/message_lite.h(467): warning C4251: 'google::protobuf::MessageLite::_internal_metadata_': class 'google::protobuf::internal::InternalMetadata' needs to have dll-interface to be used by clients of class 'google::protobuf::MessageLite' C:\opt\ros\noetic\x64\include\google/protobuf/metadata_lite.h(59): note: see declaration of 'google::protobuf::internal::InternalMetadata' C:\opt\ros\noetic\x64\include\google/protobuf/implicit_weak_message.h(94): warning C4251: 'google::protobuf::internal::ImplicitWeakMessage::data_': class 'std::basic_string,std::allocator>' needs to have dll-interface to be used by clients of class 'google::protobuf::internal::ImplicitWeakMessage' C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\include\xstring(4648): note: see declaration of 'std::basic_string,std::allocator>' C:\opt\ros\noetic\x64\include\google/protobuf/io/zero_copy_stream_impl_lite.h(243): warning C4251: 'google::protobuf::io::CopyingInputStreamAdaptor::buffer_': class 'std::unique_ptr>' needs to have dll-interface to be used by clients of class 'google::protobuf::io::CopyingInputStreamAdaptor' C:\opt\ros\noetic\x64\include\google/protobuf/io/zero_copy_stream_impl_lite.h(243): note: see declaration of 'std::unique_ptr>' C:\opt\ros\noetic\x64\include\google/protobuf/io/zero_copy_stream_impl_lite.h(332): warning C4251: 'google::protobuf::io::CopyingOutputStreamAdaptor::buffer_': class 'std::unique_ptr>' needs to have dll-interface to be used by clients of class 'google::protobuf::io::CopyingOutputStreamAdaptor' C:\opt\ros\noetic\x64\include\google/protobuf/io/zero_copy_stream_impl_lite.h(243): note: see declaration of 'std::unique_ptr>' C:\opt\ros\noetic\x64\include\google/protobuf/unknown_field_set.h(206): warning C4251: 'google::protobuf::UnknownFieldSet::fields_': class 'std::vector>' needs to have dll-interface to be used by clients of class 'google::protobuf::UnknownFieldSet' C:\opt\ros\noetic\x64\include\google/protobuf/unknown_field_set.h(206): note: see declaration of 'std::vector>' C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(215): warning C4100: 'field': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(219): warning C4100: 'descriptor': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/message.h(1029): warning C4100: 'message': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(427): warning C4251: 'google::protobuf::TextFormat::Printer::default_field_value_printer_': class 'std::unique_ptr>' needs to have dll-interface to be used by clients of class 'google::protobuf::TextFormat::Printer' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(427): note: see declaration of 'std::unique_ptr>' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(431): warning C4251: 'google::protobuf::TextFormat::Printer::custom_printers_': class 'std::map>,std::less,std::allocator>>>>' needs to have dll-interface to be used by clients of class 'google::protobuf::TextFormat::Printer' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(428): note: see declaration of 'std::map>,std::less,std::allocator>>>>' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(435): warning C4251: 'google::protobuf::TextFormat::Printer::custom_message_printers_': class 'std::map>,std::less,std::allocator>>>>' needs to have dll-interface to be used by clients of class 'google::protobuf::TextFormat::Printer' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(433): note: see declaration of 'std::map>,std::less,std::allocator>>>>' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(521): warning C4251: 'google::protobuf::TextFormat::ParseInfoTree::locations_': class 'std::map>,std::less,std::allocator>>>>' needs to have dll-interface to be used by clients of class 'google::protobuf::TextFormat::ParseInfoTree' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(512): note: see declaration of 'std::map>,std::less,std::allocator>>>>' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(522): warning C4251: 'google::protobuf::TextFormat::ParseInfoTree::nested_': class 'std::map>,std::allocator>>>,std::less,std::allocator>,std::allocator>>>>>>' needs to have dll-interface to be used by clients of class 'google::protobuf::TextFormat::ParseInfoTree' C:\opt\ros\noetic\x64\include\google/protobuf/text_format.h(517): note: see declaration of 'std::map>,std::allocator>>>,std::less,std::allocator>,std::allocator>>>>>>' C:\opt\ros\noetic\x64\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example: - add -D_WIN32_WINNT=0x0601 to the compiler command line; or - add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions. Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target). C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(171): error C2143: syntax error: missing '}' before 'constant' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(171): error C2059: syntax error: 'constant' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(172): error C2143: syntax error: missing ';' before '}' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(172): error C2238: unexpected token(s) preceding ';' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): error C2433: 'SwitchState': 'virtual' not permitted on data declarations C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): error C2146: syntax error: missing ';' before identifier 'switchResult' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(176): error C2270: 'switchResult': modifiers not allowed on nonmember functions C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(176): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(177): error C2825: 'hardware_interface::SwitchState': must be a class or namespace when followed by '::' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(177): error C2510: 'SwitchState': left of '::' must be a class/struct/union C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(177): error C2065: 'DONE': undeclared identifier C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C2433: 'SwitchState': 'virtual' not permitted on data declarations C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C2086: 'int hardware_interface::SwitchState': redefinition C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): note: see declaration of 'hardware_interface::SwitchState' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C2146: syntax error: missing ';' before identifier 'switchResult' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(182): error C2270: 'switchResult': modifiers not allowed on nonmember functions C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(182): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(183): error C2825: 'hardware_interface::SwitchState': must be a class or namespace when followed by '::' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(183): error C2510: 'SwitchState': left of '::' must be a class/struct/union C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(183): error C2065: 'DONE': undeclared identifier C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(206): error C2575: 'read': only member functions and bases can be virtual C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(224): error C2575: 'write': only member functions and bases can be virtual C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(229): error C2065: 'RobotHW': undeclared identifier C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(229): error C2923: 'std::shared_ptr': 'RobotHW' is not a valid template type argument for parameter '_Ty' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(231): error C2059: syntax error: '}' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(231): error C2143: syntax error: missing ';' before '}' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\assert.h(14): error C2143: syntax error: missing ';' before '{' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\assert.h(14): error C2447: '{': missing function header (old-style formal list?) ninja: build stopped: subcommand failed. ```

Is this some sort of syntax error in one of the files?

gavanderhoorn commented 3 years ago

Is this some sort of syntax error in one of the files?

No, not really.

This is a problem with ros_control, or more specifically, the hardware_interface package of ros_control. Your problem is similar/identical to Build kuka_experimental package on Windows 10 ROS1 noetic on ROS Answers (it's about kuka_experimental, but that also uses ros_control).

The error is this (from here):

  enum class SwitchState
  {
    DONE,
    ONGOING,
    ERROR
  };

ERROR is #defined in some Windows header, which causes a problem here in this enum.

(Edit: or at least: this is my understanding, perhaps @ooeygui will correct me)

I'm not really sure why @jontje hasn't run into this, but perhaps @ooeygui can help us come up with a work-around.

He's worked on the kuka_experimental issue https://github.com/ms-iot/ROSOnWindows/issues/294 (in https://github.com/ms-iot/kuka_experimental/pull/2).

gavanderhoorn commented 3 years ago

@traversaro would perhaps have run into this problem with hardware_interface on Windows?

jontje commented 3 years ago

I'm not a windows user myself, but I know that @jontje uses the driver on Windows.

Yes, I am using the driver on Windows, though I have only used it with ROS Melodic, and if I remember correctly, then I just followed the Melodic installation instructions found here.

I'm not really sure why @jontje hasn't run into this

Regarding compiling the driver, then I just downloaded the driver packages and build them with catkin_make_isolated. I haven't needed to make any local changes, not even related to the non-ASCII characters in the abb_rapid_msg package.

traversaro commented 3 years ago

@traversaro would perhaps have run into this problem with hardware_interface on Windows?

I never used ros_control on Windows. However, the ERROR macro collision with the macros defined in Windows.h is unfortunately quite common. The most common workaround is to avoid as much as possible to include Windows.h in header files, and only include it in the compilation unit that they use it, and even try to include it as last header. A more complicate workaround is to have something to explicitly define and undefine the offending macros, as done in protobuf with the port_def.inc and port_undef.inc :

gavanderhoorn commented 3 years ago

@traversaro wrote:

I never used ros_control on Windows.

https://github.com/ms-iot/ROSOnWindows/issues/294#issuecomment-711885007, hmm? :)

A more complicate workaround is to have something to explicitly define and undefine the offending macros, as done in protobuf with the port_def.inc and port_undef.inc

hm, annoying.

And it's also not here, but in ros_control. @bmagyar has anyone complained about this (ie: ros_control on Windows) before to your knowledge? Would patches to fix this be merged quickly?

Note: this is not ros2_control, but plain ros_control.

traversaro commented 3 years ago

@traversaro wrote:

I never used ros_control on Windows.

ms-iot/ROSOnWindows#294 (comment), hmm? :)

Quoting for the issue:

because we needed a non-ROS package to consume it as a dependency, so even if the fix was upstreamed we could not use it.

Our local modification transformed the RSI driver in a standalone library and switched to use cartesian interface instead of the joint one, so the first thing done was to remove any ros_control dependency.

gavanderhoorn commented 3 years ago

Our local modification transformed the RSI driver in a standalone library and switched to use cartesian interface instead of the joint one, so the first thing done was to remove any ros_control dependency.

I would've used a different RSI implementation in that case, but ok, clear.

traversaro commented 3 years ago

And it's also not here, but in ros_control. @bmagyar has anyone complained about this (ie: ros_control on Windows) before to your knowledge? Would patches to fix this be merged quickly?

To clarify, the offending include is in ros_control, but the problem only appears if someone is including windows.h, did you tracked who is including windows.h ?

gavanderhoorn commented 3 years ago

No. I don't have a Windows build environment setup.

Compiler output is in https://github.com/ros-industrial/abb_robot_driver/issues/17#issuecomment-791134213 :(

Edit: and confusingly @jontje doesn't run into the problem: https://github.com/ros-industrial/abb_robot_driver/issues/17#issuecomment-791311493.

traversaro commented 3 years ago

Our local modification transformed the RSI driver in a standalone library and switched to use cartesian interface instead of the joint one, so the first thing done was to remove any ros_control dependency.

I would've used a different RSI implementation in that case, but ok, clear.

Yes, effectively over time our became a completely separate RSI implementation (also class names and everything else is different, and all the XML message changed).

gavanderhoorn commented 3 years ago

off-topic, but:

effectively over time our became a completely separate RSI implementation (also class names and everything else is different, and all the XML message changed).

would be interesting to take a look. There isn't that much public code dealing with RSI.

It would be really nice if KUKA could provide a reference implementation of a properly written RSI server. That would significantly reduce the maintenance of all these RSI interfaces.

dyumanaditya commented 3 years ago

Hi, Thanks for the answers.

This is a problem with ros_control, or more specifically, the hardware_interface package of ros_control.

None of the installed packages (as listed here) in my catkin_ws show any sign of a ros_control package, or am I missing something? Or is ros_control installed by default with ROS ?

The next step as I understand will be to search for a file that has #include Windows.h, and try the workaround that @traversaro mentioned. And this file is located somewhere in ros_control .Is that corrrect?

gavanderhoorn commented 3 years ago

@DyumanAditya wrote:

None of the installed packages (as listed here) in my catkin_ws show any sign of a ros_control package, or am I missing something?

perhaps the fact that abb_robot_driver is a ros_control-based implementation of a hardware_interface? :)

Or is ros_control installed by default with ROS ?

Not "with ROS". Perhaps with "ROS Noetic as ported and distributed by MS".

The next step as I understand will be to search for a file that has #include Windows.h, and try the workaround that @traversaro mentioned. And this file is located somewhere in ros_control .Is that corrrect?

Well, sort-of.

It's not entirely certain there is anything including that header directly.

That's why I asked @ooeygui whether he's aware of any existing issues with the hardware_interface package. If they'd already fixed or worked around it, it would save us some effort.

dyumanaditya commented 3 years ago

Update: I installed ROS Melodic, and tried building the package. I didn't have the problem relating to the non-ASCII characters but ended up with the same final error as with Noetic. Don't know how much this helps, but thought I'd put it up.

traversaro commented 3 years ago

No. I don't have a Windows build environment setup.

Compiler output is in #17 (comment) :(

Ah, I see thanks. The affected compilation unit seems https://github.com/ros-industrial/abb_robot_driver/blob/master/abb_egm_hardware_interface/src/egm_hardware_interface.cpp .

In my experience Protobuf headers may include Windows.h, so a first test that it may be worth is to do is move the #include <google/protobuf/text_format.h> from https://github.com/ros-industrial/abb_robot_driver/blob/master/abb_egm_hardware_interface/src/egm_hardware_interface.cpp#L40 to be included after #include "abb_egm_hardware_interface/egm_hardware_interface.h" .

gavanderhoorn commented 3 years ago

@DyumanAditya wrote:

Update: I installed ROS Melodic, and tried building the package. I didn't have the problem relating to the non-ASCII characters but ended up with the same final error as with Noetic. Don't know how much this helps, but thought I'd put it up.

that's indeed useful. And a bit confusing, as that's essentially @jontje's setup. Unless of course you have a more recent install of some package.

@traversaro wrote:

In my experience Protobuf headers may include Windows.h, so a first test that it may be worth is to do is move the #include <google/protobuf/text_format.h> from https://github.com/ros-industrial/abb_robot_driver/blob/master/abb_egm_hardware_interface/src/egm_hardware_interface.cpp#L40 to be included after #include "abb_egm_hardware_interface/egm_hardware_interface.h" .

@DyumanAditya: could you try this?

dyumanaditya commented 3 years ago

@traversaro wrote:

In my experience Protobuf headers may include Windows.h, so a first test that it may be worth is to do is move the #include <google/protobuf/text_format.h> from https://github.com/ros-industrial/abb_robot_driver/blob/master/abb_egm_hardware_interface/src/egm_hardware_interface.cpp#L40 to be included after #include "abb_egm_hardware_interface/egm_hardware_interface.h" .

I tried this, and get essentially the same errors, although it looks slightly different towards the end:

Click to expand ``` ==> Processing catkin package: 'abb_egm_hardware_interface' ==> Creating build directory: 'build_isolated\abb_egm_hardware_interface' ==> Building with env: 'C:\Users\Dyuman\catkin_ws\devel_isolated\abb_robot_cpp_utilities\env.bat' ==> cmake C:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_egm_hardware_interface -DCATKIN_DEVEL_PREFIX=C:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_hardware_interface -DCMAKE_INSTALL_PREFIX=C:\Users\Dyuman\catkin_ws\install_isolated -DCMAKE_BUILD_TYPE=RelWithDebInfo -G Ninja in 'C:\Users\Dyuman\catkin_ws\build_isolated\abb_egm_hardware_interface' -- The CXX compiler identification is MSVC 19.28.29337.0 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for C++ include pthread.h -- Looking for C++ include pthread.h - not found -- Found Threads: TRUE -- Found Boost: C:/opt/ros/noetic/x64/include (found version "1.73.0") found components: regex system thread chrono date_time atomic -- Searching for Poco library... -- Found Poco! -- components found: Foundation, Net, Util, XML. -- Found Protobuf: C:/opt/ros/noetic/x64/Lib/libprotobuf.lib (found version "3.12.3") -- Using CATKIN_DEVEL_PREFIX: C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_hardware_interface -- Using CMAKE_PREFIX_PATH: C:\opt\ros\noetic\x64\tools\vcpkg\installed\x64-windows;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_cpp_utilities;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_bringup_examples;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_rapid_sm_addin_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_rapid_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_rws_managers;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_librws;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_libegm;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_msgs;c:\opt\ros\noetic\x64 -- This workspace overlays: C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_cpp_utilities;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_robot_bringup_examples;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_rapid_sm_addin_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_rapid_msgs;C:/Users/Dyuman/catkin_ws/devel_isolated/abb_egm_msgs;c:/opt/ros/noetic/x64 -- Found PythonInterp: C:/opt/ros/noetic/x64/python.exe (found suitable version "3.8.3", minimum required is "3") -- Using PYTHON_EXECUTABLE: C:/opt/ros/noetic/x64/python.exe -- Using default Python package layout -- Found PY_em: C:\opt\ros\noetic\x64\lib\site-packages\em.py -- Using empy: C:/opt/ros/noetic/x64/lib/site-packages/em.py -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: C:/Users/Dyuman/catkin_ws/build_isolated/abb_egm_hardware_interface/test_results -- Found gtest: gtests will be built -- Using Python nosetests: C:/opt/ros/noetic/x64/Scripts/nosetests.exe -- catkin 0.8.9 -- BUILD_SHARED_LIBS is on -- Configuring done -- Generating done -- Build files have been written to: C:/Users/Dyuman/catkin_ws/build_isolated/abb_egm_hardware_interface ==> ninja -j8 -l8 in 'C:\Users\Dyuman\catkin_ws\build_isolated\abb_egm_hardware_interface' [3/10] Building CXX object CMakeFiles\abb_egm_hardware_interface_controller_stopper_exe.dir\src\egm_controller_stopper_main.cpp.obj cl : Command line warning D9025 : overriding '/W3' with '/W4' C:\opt\ros\noetic\x64\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. [4/10] Building CXX object CMakeFiles\abb_egm_hardware_interface_hardware_interface.dir\src\egm_hardware_interface.cpp.obj FAILED: CMakeFiles/abb_egm_hardware_interface_hardware_interface.dir/src/egm_hardware_interface.cpp.obj C:\PROGRA~2\MICROS~2\2019\COMMUN~1\VC\Tools\MSVC\1428~1.293\bin\Hostx64\x64\cl.exe /nologo /TP -DNOMINMAX -DPROTOBUF_USE_DLLS -DROSCONSOLE_BACKEND_LOG4CXX -DROS_BUILD_SHARED_LIBS=1 -DROS_PACKAGE_NAME=\"abb_egm_hardware_interface\" -DWIN32_LEAN_AND_MEAN -D_USE_MATH_DEFINES -Dabb_egm_hardware_interface_hardware_interface_EXPORTS -IC:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_egm_hardware_interface\include -IC:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_robot_cpp_utilities\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_robot_msgs\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_rapid_sm_addin_msgs\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_rapid_msgs\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_msgs\include -IC:\opt\ros\noetic\x64\share\xmlrpcpp\cmake\..\..\..\include\xmlrpcpp -IC:\opt\ros\noetic\x64\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_egm_rws_managers\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_libegm\include -IC:\Users\Dyuman\catkin_ws\devel_isolated\abb_librws\include /DWIN32 /D_WINDOWS /W3 /GR /EHsc /MD /Zi /O2 /Ob1 /DNDEBUG /D _VARIADIC_MAX=10 /Zc:__cplusplus /W4 /FIC:/Users/Dyuman/catkin_ws/build_isolated/abb_egm_rws_managers/devel/abb_egm_rws_managers_export.h /FIC:/Users/Dyuman/catkin_ws/build_isolated/abb_libegm/devel/abb_libegm_export.h /showIncludes /FoCMakeFiles\abb_egm_hardware_interface_hardware_interface.dir\src\egm_hardware_interface.cpp.obj /FdCMakeFiles\abb_egm_hardware_interface_hardware_interface.dir\ /FS -c C:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_egm_hardware_interface\src\egm_hardware_interface.cpp cl : Command line warning D9025 : overriding '/W3' with '/W4' C:\opt\ros\noetic\x64\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(358): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(365): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(215): warning C4100: 'field': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(219): warning C4100: 'descriptor': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/message.h(1029): warning C4100: 'message': unreferenced formal parameter Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example: - add -D_WIN32_WINNT=0x0601 to the compiler command line; or - add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions. Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target). C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(171): error C2143: syntax error: missing '}' before 'constant' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(171): error C2059: syntax error: 'constant' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(172): error C2143: syntax error: missing ';' before '}' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(172): error C2238: unexpected token(s) preceding ';' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): error C2433: 'SwitchState': 'virtual' not permitted on data declarations C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): error C2146: syntax error: missing ';' before identifier 'switchResult' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(176): error C2270: 'switchResult': modifiers not allowed on nonmember functions C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(176): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(177): error C2825: 'hardware_interface::SwitchState': must be a class or namespace when followed by '::' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(177): error C2510: 'SwitchState': left of '::' must be a class/struct/union C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(177): error C2065: 'DONE': undeclared identifier C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C2433: 'SwitchState': 'virtual' not permitted on data declarations C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C2086: 'int hardware_interface::SwitchState': redefinition C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(175): note: see declaration of 'hardware_interface::SwitchState' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(181): error C2146: syntax error: missing ';' before identifier 'switchResult' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(182): error C2270: 'switchResult': modifiers not allowed on nonmember functions C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(182): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(183): error C2825: 'hardware_interface::SwitchState': must be a class or namespace when followed by '::' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(183): error C2510: 'SwitchState': left of '::' must be a class/struct/union C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(183): error C2065: 'DONE': undeclared identifier C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(206): error C2575: 'read': only member functions and bases can be virtual C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(224): error C2575: 'write': only member functions and bases can be virtual C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(229): error C2065: 'RobotHW': undeclared identifier C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(229): error C2923: 'std::shared_ptr': 'RobotHW' is not a valid template type argument for parameter '_Ty' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(231): error C2059: syntax error: '}' C:\opt\ros\noetic\x64\include\hardware_interface/robot_hw.h(231): error C2143: syntax error: missing ';' before '}' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\assert.h(14): error C2143: syntax error: missing ';' before '{' C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\assert.h(14): error C2447: '{': missing function header (old-style formal list?) [5/10] Building CXX object CMakeFiles\abb_egm_hardware_interface_controller_stopper.dir\src\egm_controller_stopper.cpp.obj cl : Command line warning D9025 : overriding '/W3' with '/W4' C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(358): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(365): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(215): warning C4100: 'field': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(219): warning C4100: 'descriptor': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/message.h(1029): warning C4100: 'message': unreferenced formal parameter C:\Users\Dyuman\catkin_ws\devel_isolated\abb_librws\include\abb_librws\rws_poco_client.h(424): warning C4244: 'initializing': conversion from 'double' to 'const Poco::Int64', possible loss of data C:\Users\Dyuman\catkin_ws\devel_isolated\abb_librws\include\abb_librws\rws_client.h(836): warning C4244: 'initializing': conversion from 'double' to 'const Poco::Int64', possible loss of data C:\opt\ros\noetic\x64\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. C:\opt\ros\noetic\x64\include\ros/message_event.h(217): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\ros/message_event.h(160): note: see reference to function template instantiation 'boost::shared_ptr ros::MessageEvent>>::copyMessageIfNecessary(void) const' being compiled with [ M=const abb_egm_msgs::EGMState_> ] C:\opt\ros\noetic\x64\include\ros/message_event.h(160): note: see reference to function template instantiation 'boost::shared_ptr ros::MessageEvent>>::copyMessageIfNecessary(void) const' being compiled with [ M=const abb_egm_msgs::EGMState_> ] C:\opt\ros\noetic\x64\include\ros/message_event.h(159): note: while compiling class template member function 'boost::shared_ptr ros::MessageEvent>>::getMessage(void) const' C:\opt\ros\noetic\x64\include\ros/parameter_adapter.h(92): note: see reference to function template instantiation 'boost::shared_ptr ros::MessageEvent>>::getMessage(void) const' being compiled C:\opt\ros\noetic\x64\include\ros/subscription_callback_helper.h(143): note: see reference to class template instantiation 'ros::MessageEvent>>' being compiled C:\opt\ros\noetic\x64\include\ros/subscription_callback_helper.h(142): note: while compiling class template member function 'void ros::SubscriptionCallbackHelperT &,void>::call(ros::SubscriptionCallbackHelperCallParams &)' C:\opt\ros\noetic\x64\include\boost/smart_ptr/detail/sp_convertible.hpp(49): note: see reference to class template instantiation 'ros::SubscriptionCallbackHelperT &,void>' being compiled C:\opt\ros\noetic\x64\include\boost/smart_ptr/detail/sp_convertible.hpp(82): note: see reference to class template instantiation 'boost::detail::sp_convertible' being compiled with [ Y=ros::SubscriptionCallbackHelperT &,void>, T=ros::SubscriptionCallbackHelper ] C:\opt\ros\noetic\x64\include\ros/subscribe_options.h(112): note: see reference to class template instantiation 'boost::detail::sp_enable_if_convertible &,void>,T>' being compiled with [ T=ros::SubscriptionCallbackHelper ] C:\opt\ros\noetic\x64\include\boost/smart_ptr/shared_ptr.hpp(643): note: while compiling class template member function 'boost::shared_ptr::shared_ptr(boost::shared_ptr &&,boost::detail::sp_enable_if_convertible::type) noexcept' with [ T=ros::SubscriptionCallbackHelper ] C:\opt\ros\noetic\x64\include\ros/node_handle.h(470): note: see reference to function template instantiation 'void ros::SubscribeOptions::init(const std::string &,uint32_t,const boost::function &)> &,const boost::function (void)> &)' being compiled with [ M=abb_egm_msgs::EGMState ] C:\Users\Dyuman\catkin_ws\src\abb_robot_driver\abb_egm_hardware_interface\src\egm_controller_stopper.cpp(95): note: see reference to function template instantiation 'ros::Subscriber ros::NodeHandle::subscribe(const std::string &,uint32_t,void (__cdecl abb::robot::EGMControllerStopper::* )(const boost::shared_ptr &),T *,const ros::TransportHints &)' being compiled with [ T=abb::robot::EGMControllerStopper ] [6/10] Building CXX object CMakeFiles\abb_egm_hardware_interface_hardware_interface_exe.dir\src\egm_hardware_interface_main.cpp.obj cl : Command line warning D9025 : overriding '/W3' with '/W4' C:\opt\ros\noetic\x64\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior. C:\opt\ros\noetic\x64\include\controller_manager/controller_spec.h(33): warning C4068: unknown pragma 'GCC' C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(358): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/stubs/strutil.h(365): warning C4127: conditional expression is constant C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(215): warning C4100: 'field': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/generated_message_reflection.h(219): warning C4100: 'descriptor': unreferenced formal parameter C:\opt\ros\noetic\x64\include\google/protobuf/message.h(1029): warning C4100: 'message': unreferenced formal parameter Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example: - add -D_WIN32_WINNT=0x0601 to the compiler command line; or - add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions. Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target). ninja: build stopped: subcommand failed. <== Failed to process package 'abb_egm_hardware_interface': Command '['C:\\Users\\Dyuman\\catkin_ws\\devel_isolated\\abb_robot_cpp_utilities\\env.bat', 'ninja', '-j8', '-l8']' returned non-zero exit status 1. Reproduce this error by running: ==> cd 'C:\Users\Dyuman\catkin_ws\build_isolated\abb_egm_hardware_interface' && 'C:\Users\Dyuman\catkin_ws\devel_isolated\abb_robot_cpp_utilities\env.bat' ninja -j8 -l8 Command failed, exiting. ```
traversaro commented 3 years ago

Really OT, but on the other hand I tried to provided a hopefully useful hint in the previous comment.

off-topic, but:

effectively over time our became a completely separate RSI implementation (also class names and everything else is different, and all the XML message changed).

would be interesting to take a look. There isn't that much public code dealing with RSI.

Yes, I will be happy to share it. Especially the semantics of the cartesian orientation correction is quite a mistery, we got it work from trial and error (see https://github.com/cjlh/kuka-rsi-ros-interface/issues/1 for a related discussion).

It would be really nice if KUKA could provide a reference implementation of a properly written RSI server. That would significantly reduce the maintenance of all these RSI interfaces.

Yes, kuka_librsi would be great. In particular, most of the RSI implementations I found kind of hardcode in C++ code the specific structure of the message that is specified in the RSI .xml file (for example https://github.com/ros-industrial/kuka_experimental/blob/indigo-devel/kuka_rsi_hw_interface/krl/KR_C4/ros_rsi_ethernet.xml), so anytime the user modify the .xml needs also to modify the C++ parser code. A RSI parser that loads the expected structure of the RSI message from .xml files would be extremely handy. fyi @ahoarau .

traversaro commented 3 years ago

@traversaro wrote:

In my experience Protobuf headers may include Windows.h, so a first test that it may be worth is to do is move the #include <google/protobuf/text_format.h> from https://github.com/ros-industrial/abb_robot_driver/blob/master/abb_egm_hardware_interface/src/egm_hardware_interface.cpp#L40 to be included after #include "abb_egm_hardware_interface/egm_hardware_interface.h" .

I tried this, and get essentially the same errors, although it looks slightly different towards the end:

Apparently something else brings in protobuf headers. Then the only alternative is to either generate the full header include tree to understand who is including it (by adding /showIncludes to CMAKE_CXX_FLAGS, not sure how you do that via catkin), or just add a:

#pragma push_macro("ERROR")
#undef ERROR

before the problematic ros_control include, and:

#pragma pop_macro("ERROR")

after. However, this is not a great solution if some other part of the code use the ERROR as defined by ros_control.

dyumanaditya commented 3 years ago

or just add a:

#pragma push_macro("ERROR")
#undef ERROR

before the problematic ros_control include, and:

#pragma pop_macro("ERROR")

after. However, this is not a great solution if some other part of the code use the ERROR as defined by ros_control.

Do you have any suggestions as to where I can look for the problematic ros_control include?

dyumanaditya commented 3 years ago

@traversaro, this is what I did: in abb_robot_driver/abb_egm_hardware_interface/src/egm_hardware_interface.cpp I modified the line #include "abb_egm_hardware_interface/egm_hardware_interface.h" to:

#pragma push_macro("ERROR")
#undef ERROR
#include "abb_egm_hardware_interface/egm_hardware_interface.h"
#pragma pop_macro("ERROR")

And in abb_robot_driver/abb_egm_state_controller/src/egm_state_controller.cpp, I modified the line #include "abb_egm_state_controller/egm_state_controller.h" to :

#pragma push_macro("ERROR")
#undef ERROR
#include "abb_egm_state_controller/egm_state_controller.h"
#pragma pop_macro("ERROR")

I was able to build the package successfully! What are the possible repercussions that might arise from this modification though?

bmagyar commented 3 years ago

And it's also not here, but in ros_control. @bmagyar has anyone complained about this (ie: ros_control on Windows) before to your knowledge?

We received a couple of PRs from the "ROS guys" at Microsoft, mostly in 2019. Nothing major, mostly tweaks to how certain things were expressed in the code to make it compile on Windows.

Would patches to fix this be merged quickly?

Of course. Provided that they are not breaking and have some testing (if not covered already by existing tests).

traversaro commented 3 years ago

I just realized that at RoboStack we are building ros-control packages for Windows, and there are no Windows-specific patches for ros_control, see https://github.com/RoboStack/ros-noetic/tree/master/patch (unless I am wrong, @Tobias-Fischer feel free to correct me). Then probably the problem does not arise when building ros_control on its own as no one in its compilation units is including Windows.h .

gavanderhoorn commented 3 years ago

@traversaro @bmagyar: I'm not sure, but there seem to be some ERROR and OK related changed in https://github.com/ms-iot/kuka_experimental/pull/2.

ooeygui commented 3 years ago

A hold over from early DOS, ERROR, OK and several other common words were #defined. For source compatibility, these were brought into headers brought into windows.h. #define is not namespaced, so any user downstream will have these overwritten - and ultimately have a duplicate define or build break.

For most of ROS, we were able to resolve this, as ROS headers do include windows,h, but have an #undef ERROR to work around the ROS versions of ERROR, including those in msg files.

Internally to boost, the headers will include windows,h, which will redefine ERROR. In order to not pollute the code with Windows specific things, we typically reorder headers if that resolves the build break, otherwise add an additional #undef ERROR after boost headers.

I hope that helps explaining the root cause.

gavanderhoorn commented 3 years ago

Thanks @ooeygui, this seems to confirm what @traversaro also described.

Would it make sense to put the work-arounds from https://github.com/ros-industrial/abb_robot_driver/issues/17#issuecomment-791497279 somewhere in ros_control (wrapped in suitable #ifdefs), or would it be more prudent to do this on a case-by-case basis?

gavanderhoorn commented 3 years ago

I believe @lilustga commented here but then removed it.

@lilustga: I believe what you suggested was already tried by @DyumanAditya, could you confirm?

lilustga commented 3 years ago

@gavanderhoorn, Saw Lou's prior comment and realized it was redundant so removed it.

gavanderhoorn commented 3 years ago

Would it make sense to put the work-arounds from https://github.com/ros-industrial/abb_robot_driver/issues/17#issuecomment-791497279 somewhere in ros_control (wrapped in suitable #ifdefs), or would it be more prudent to do this on a case-by-case basis?

@ooeygui @lilustga, what's your opinion?

lilustga commented 3 years ago

It looks like ERROR is used both in the SwitchState enum where this conflict occurred as well as the JointCommandModes enum in joint_mod_interface.h. ERROR is not pound defined in ros_control and I don't believe the enums will be affected by the pop_macro. Given this, it would be safe to use this workaround within ros_control.

@ooeygui, thoughts?

ooeygui commented 3 years ago

@gavanderhoorn We have put in #undef error in some header files attempting to work around this problem. Windows.h can leak in various places after the workarounds are in place, which triggers this bug downstream. We have tried disabling the Windows include causing this problem (wingdi.h), but that negatively impacts other places. Unfortunately, we're at a point that this needs to be worked around on a case by case basis.

bmagyar commented 3 years ago

My 2cents: wouldn't it be easier to bind the abb driver binaries somehow in a Unix environment so you don't need to go through this Herculean (or perhaps Don Quixoten?) effort? It will be quite hard to ensure everything keep working over time...

gavanderhoorn commented 3 years ago

Could you clarify what you mean by that @bmagyar ?

Are you saying we should prevent people from trying to build this on Windows?

ooeygui commented 3 years ago

@bmagyar Keeping it building is quite easy - github actions can be added to build on Linux and Windows during CI. Check out https://aka.ms/ros for the docs.

bmagyar commented 3 years ago

Sorry for the previous post, for a moment I misunderstood and thought it is to build some windows stuff for the driver to work on Linux

I'd still throw in the idea of trying to avoid the offending header completely.

On Thu, 11 Mar 2021, 20:47 G.A. vd. Hoorn, @.***> wrote:

Could you clarify what you mean by that @bmagyar https://github.com/bmagyar ?

Are you saying we should prevent people from trying to build this on Windows?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ros-industrial/abb_robot_driver/issues/17#issuecomment-797038435, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA24PYMYIG2G7F7DEOW7PXTTDET75ANCNFSM4YS7D4WA .

gavanderhoorn commented 3 years ago

@bmagyar wrote:

I'd still throw in the idea of trying to avoid the offending header completely.

depending on your perspective, the offending header would be one of the core Windows headers, or the one in ros_control which defines the ERROR members in those enums ;)

I'm not sure which of the two would be easier to get rid of, so it seems we're stuck with adding some work-arounds.

traversaro commented 3 years ago

Thanks to https://github.com/ros-controls/ros_control/pull/492 I found https://github.com/ros-controls/ros_control/pull/397, that seems to be related to this discussion.

gavanderhoorn commented 3 years ago

Thanks for that. The fix in https://github.com/ros-simulation/gazebo_ros_pkgs/pull/1023 seems like something which we could use here.

It isn't a hack, clearly visible in the build script and there's precedence for it in a package which sees a lot of usage.

bmagyar commented 3 years ago

I'm very much in support of the -DNOGDI approach!

enricovillagrossi commented 2 years ago

May I ask if is there any official fix to solve the compile error? Because I'm getting the same problem compiling abb_robot_driver on Windows with ROS Noetic as @DyumanAditya.

traversaro commented 2 years ago

Hi @enricovillagrossi !

Based on the latest messages from @bmagyar and @gavanderhoorn you probably can try to add:

## Restrict Windows header namespace usage
if(WIN32)
  add_definitions(-DNOGDI)
endif()

in https://github.com/ros-industrial/abb_robot_driver/blob/master/abb_egm_hardware_interface/CMakeLists.txt#L105 (or anyhow somewhere before the add_library).