Closed aeites closed 1 year ago
Hi, I made some fixes, can you try the newest version?
Hi,
It looks like you've fixed the file generation, nice!
But now I'm running into the same issue as described in issue #12. It looks like the headers of the Windows ROS2 libraries aren't set up properly, or perhaps I'm linking them incorrectly.
The environment setup:
SET GOOS=windows
SET GOARCH=386
SET CGO_ENABLED=1
SET CGO_CFLAGS=-IC:\dev\ros2_humble\include\rosidl_runtime_c -IC:\dev\ros2_humble\include\rcl_action -IC:\dev\ros2_humble\include\action_msgs -IC:\dev\ros2_humble\include\unique_identifier_msgs -IC:\dev\ros2_humble\include\builtin_interfaces -IC:\dev\ros2_humble\include\rosidl_typesupport_interface -IC:\dev\ros2_humble\include\rcl -IC:\dev\ros2_humble\include\rcutils -IC:\dev\ros2_humble\include\rmw -IC:\dev\ros2_humble\include\rcl_yaml_param_parser
SET CGO_LDFLAGS=-LC:\dev\ros2_humble\Lib -Wl,-rpath,li
Compiler: tdm-gcc
Then afterwards I receive the following errors when I go build
..\..\..\pkg\rclgo\action.go:416:12: could not determine kind of name for C.rcl_action_accept_new_goal
..\..\..\pkg\rclgo\action.go:649:9: could not determine kind of name for C.rcl_action_cancel_response_fini
..\..\..\pkg\rclgo\action.go:888:8: could not determine kind of name for C.rcl_action_client_fini
..\..\..\pkg\rclgo\action.go:862:8: could not determine kind of name for C.rcl_action_client_init
..\..\..\pkg\rclgo\action.go:1213:8: could not determine kind of name for C.rcl_action_client_wait_set_get_entities_ready
..\..\..\pkg\rclgo\action.go:535:9: could not determine kind of name for C.rcl_action_expire_goals
..\..\..\pkg\rclgo\action.go:693:8: could not determine kind of name for C.rcl_action_get_goal_status_array
..\..\..\pkg\rclgo\action.go:633:13: could not determine kind of name for C.rcl_action_get_zero_initialized_cancel_response
..\..\..\pkg\rclgo\action.go:829:16: could not determine kind of name for C.rcl_action_get_zero_initialized_client
..\..\..\pkg\rclgo\action.go:110:17: could not determine kind of name for C.rcl_action_get_zero_initialized_goal_info
..\..\..\pkg\rclgo\action.go:691:14: could not determine kind of name for C.rcl_action_get_zero_initialized_goal_status_array
..\..\..\pkg\rclgo\action.go:340:14: could not determine kind of name for C.rcl_action_get_zero_initialized_server
...
cgo:
gcc errors for preamble:
In file included from C:\dev\ros2_humble\include\rcutils/rcutils/allocator.h:28,
from C:\dev\ros2_humble\include\rcl/rcl/allocator.h:25,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/types.h:30,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/action_client.h:23,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/rcl_action.h:50,
from ..\..\..\pkg\rclgo\action.go:6:
C:\dev\ros2_humble\include\rcutils/rcutils/macros.h:30:29: error: unknown type name '_Check_return_'
30 | #define RCUTILS_WARN_UNUSED _Check_return_
| ^~~~~~~~~~~~~~
C:\dev\ros2_humble\include\rcutils/rcutils/allocator.h:84:1: note: in expansion of macro 'RCUTILS_WARN_UNUSED'
84 | RCUTILS_WARN_UNUSED
| ^~~~~~~~~~~~~~~~~~~
In file included from C:\dev\ros2_humble\include\rcl/rcl/allocator.h:25,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/types.h:30,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/action_client.h:23,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/rcl_action.h:50,
from ..\..\..\pkg\rclgo\action.go:6:
C:\dev\ros2_humble\include\rcutils/rcutils/allocator.h:86:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rcutils_get_zero_initialized_allocator'
86 | rcutils_get_zero_initialized_allocator(void);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\dev\ros2_humble\include\rcutils/rcutils/allocator.h:28,
from C:\dev\ros2_humble\include\rcl/rcl/allocator.h:25,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/types.h:30,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/action_client.h:23,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/rcl_action.h:50,
from ..\..\..\pkg\rclgo\action.go:6:
C:\dev\ros2_humble\include\rcutils/rcutils/macros.h:30:29: error: unknown type name '_Check_return_'
30 | #define RCUTILS_WARN_UNUSED _Check_return_
| ^~~~~~~~~~~~~~
C:\dev\ros2_humble\include\rcutils/rcutils/allocator.h:107:1: note: in expansion of macro 'RCUTILS_WARN_UNUSED'
107 | RCUTILS_WARN_UNUSED
| ^~~~~~~~~~~~~~~~~~~
In file included from C:\dev\ros2_humble\include\rcl/rcl/allocator.h:25,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/types.h:30,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/action_client.h:23,
from C:\dev\ros2_humble\include\rcl_action/rcl_action/rcl_action.h:50,
from ..\..\..\pkg\rclgo\action.go:6:
...
I'm going to try to run this in Ubuntu instead of Windows, but if you have any other suggestions to try I'm open to them.
It looks like the rclgo greeter example builds properly in Ubuntu 22.04 out of the box with a regular ROS2 install. I'm not sure what else we'd need in Windows to accomplish this, but it seems to be a problem in the ROS2 libraries in Windows.
For the time being though, I'll just use Ubuntu.
Hi,
I'm running into some trouble running the example message generator.
I managed to set up ROS2 with the following specs for my machine:
OS: Windows 11 CPU Architecture: x86_64 ROS2 Version: Humble
When building the Go message bindings
go generate
within thegreeter
directory, I ran into a couple of problems, but most of the time I'm met with an empty message definition. I've properly sourced the ROS2 overlay but somehow the message keeps generating nothing.Here is a snippet of some commands I've been running. Is there anything out of the ordinary happening here?
Also here is the msgs.gen.go file, note that it generates an empty file: