Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I compile ros2_java on ros2 foxy version? I have tried to compile and cannot pass #227

Open
Qin-Yuan opened this issue Nov 16, 2022 · 2 comments

Comments

@Qin-Yuan
Copy link

No description provided.

@schragnasher
Copy link

schragnasher commented Dec 14, 2022

I am unable to build as well.

--- stderr: rcljava
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp: In function ‘jlong Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeAllocateRCLStatusEvent(JNIEnv*, jclass)’:
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:30:28: error: ‘rmw_message_lost_status_t’ was not declared in this scope; did you mean ‘rmw_liveliness_lost_status_
’?
   30 |   void * p = malloc(sizeof(rmw_message_lost_status_t));
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                            rmw_liveliness_lost_status_t
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp: In function ‘void Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeFromRCLEvent(JNIEnv*, jobject, jlong)’:
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:49:31: error: ‘rmw_message_lost_status_t’ does not name a type; did you mean ‘rmw_liveliness_lost_status_t’?
   49 |   auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                               rmw_liveliness_lost_status_t
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:49:57: error: expected ‘>’ before ‘*’ token
   49 |   auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
      |                                                         ^
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:49:57: error: expected ‘(’ before ‘*’ token
   49 |   auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
      |                                                         ^
      |                                                         (
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:49:58: error: expected primary-expression before ‘>’ token
   49 |   auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
      |                                                          ^
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:49:67: error: expected ‘)’ before ‘;’ token
   49 |   auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
      |                                                                   ^
      |                                                                   )
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp: In function ‘jint Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeGetSubscriptionEventType(JNIEnv*, jclass)’:
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:73:10: error: ‘RCL_SUBSCRIPTION_MESSAGE_LOST’ was not declared in this scope
   73 |   return RCL_SUBSCRIPTION_MESSAGE_LOST;
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/org_ros2_rcljava_subscription_statuses__message_lost.dir/build.make:63: CMakeFiles/org_ros2_rcljava_subscription_statuses__message_lost.dir/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1598: CMakeFiles/org_ros2_rcljava_subscription_statuses__message_lost.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:141: all] Error 2
---
Failed   <<< rcljava [12.2s, exited with code 2]
Aborted  <<< nav_msgs [0.58s]
Aborted  <<< sensor_msgs [0.59s]
Aborted  <<< diagnostic_msgs [0.60s]
Aborted  <<< visualization_msgs [0.59s]
Aborted  <<< shape_msgs [0.60s]
Aborted  <<< trajectory_msgs [0.61s]

Summary: 22 packages finished [38.7s]

@ceoifung
Copy link

I am unable to build as well.

--- stderr: rcljava
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp: In function ‘jlong Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeAllocateRCLStatusEvent(JNIEnv*, jclass)’:
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:30:28: error: ‘rmw_message_lost_status_t’ was not declared in this scope; did you mean ‘rmw_liveliness_lost_status_
’?
   30 |   void * p = malloc(sizeof(rmw_message_lost_status_t));
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                            rmw_liveliness_lost_status_t
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp: In function ‘void Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeFromRCLEvent(JNIEnv*, jobject, jlong)’:
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:49:31: error: ‘rmw_message_lost_status_t’ does not name a type; did you mean ‘rmw_liveliness_lost_status_t’?
   49 |   auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                               rmw_liveliness_lost_status_t
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:49:57: error: expected ‘>’ before ‘*’ token
   49 |   auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
      |                                                         ^
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:49:57: error: expected ‘(’ before ‘*’ token
   49 |   auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
      |                                                         ^
      |                                                         (
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:49:58: error: expected primary-expression before ‘>’ token
   49 |   auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
      |                                                          ^
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:49:67: error: expected ‘)’ before ‘;’ token
   49 |   auto * p = reinterpret_cast<rmw_message_lost_status_t *>(handle);
      |                                                                   ^
      |                                                                   )
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp: In function ‘jint Java_org_ros2_rcljava_subscription_statuses_MessageLost_nativeGetSubscriptionEventType(JNIEnv*, jclass)’:
/home/josh/ros2_java_ws/src/ros2-java/ros2_java/rcljava/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp:73:10: error: ‘RCL_SUBSCRIPTION_MESSAGE_LOST’ was not declared in this scope
   73 |   return RCL_SUBSCRIPTION_MESSAGE_LOST;
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/org_ros2_rcljava_subscription_statuses__message_lost.dir/build.make:63: CMakeFiles/org_ros2_rcljava_subscription_statuses__message_lost.dir/src/main/cpp/org_ros2_rcljava_subscription_statuses_MessageLost.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1598: CMakeFiles/org_ros2_rcljava_subscription_statuses__message_lost.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:141: all] Error 2
---
Failed   <<< rcljava [12.2s, exited with code 2]
Aborted  <<< nav_msgs [0.58s]
Aborted  <<< sensor_msgs [0.59s]
Aborted  <<< diagnostic_msgs [0.60s]
Aborted  <<< visualization_msgs [0.59s]
Aborted  <<< shape_msgs [0.60s]
Aborted  <<< trajectory_msgs [0.61s]

Summary: 22 packages finished [38.7s]

same error, Do you resolve this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants