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

Compile error:use of undeclared identifier 'rindex' #35

Open
Chris-166 opened this issue Jun 15, 2023 · 4 comments
Open

Compile error:use of undeclared identifier 'rindex' #35

Chris-166 opened this issue Jun 15, 2023 · 4 comments
Labels

Comments

@Chris-166
Copy link

Chris-166 commented Jun 15, 2023

chris@chris-166:~/Projects/ros2-android/src$ colcon build --packages-select uncrustify_vendor
Starting >>> uncrustify_vendor
--- stderr: uncrustify_vendor                            
/home/chris/Projects/ros2-android/src/build/uncrustify_vendor/uncrustify-0.72.0-prefix/src/uncrustify-0.72.0/src/log_rules.cpp:51:12: error: use of undeclared identifier 'rindex'
   where = rindex(func, ':');
           ^
1 error generated.
gmake[5]: *** [CMakeFiles/uncrustify.dir/build.make:797: CMakeFiles/uncrustify.dir/src/log_rules.cpp.o] Error 1
gmake[5]: *** Waiting for unfinished jobs....
gmake[4]: *** [CMakeFiles/Makefile2:1048: CMakeFiles/uncrustify.dir/all] Error 2
gmake[3]: *** [Makefile:166: all] Error 2
gmake[2]: *** [CMakeFiles/uncrustify-0.72.0.dir/build.make:89: uncrustify-0.72.0-prefix/src/uncrustify-0.72.0-stamp/uncrustify-0.72.0-build] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:140: CMakeFiles/uncrustify-0.72.0.dir/all] Error 2
gmake: *** [Makefile:149: all] Error 2
---
Failed   <<< uncrustify_vendor [0.68s, exited with code 2]

Summary: 0 packages finished [1.12s]
  1 package failed: uncrustify_vendor
  1 package had stderr output: uncrustify_vendor
  1. Version or commit hash
    commit ec8f8b4 (HEAD -> humble, tag: 2.0.2, origin/humble)
  2. Compilation environment:22.04.1-Ubuntu
@clalancette
Copy link
Contributor

So this is a bit of a tricky situation.

The immediate cause of the failure is that the Android libc likely doesn't have rindex.

But really, we shouldn't be compiling this particular package on Android at all, as you want to compile this on the host. We just don't have a good way to express that in our package.xml.

For now, I'm going to mark this as 'backlog' since Android isn't a supported platform.

@Chris-166
Copy link
Author

Can I switch the branch from humble to galactic to temporarily work around this issue?

@clalancette
Copy link
Contributor

Can I switch the branch from humble to galactic to temporarily work around this issue?

I doubt that will make a difference, as you'll be in a similar situation.

@NicolARun06
Copy link

NicolARun06 commented May 11, 2024

@Chris-166 I met the same issue, and I modified workspace/src/build/uncrustify_vendor/uncrustify-0.72.0-prefix/src/uncrustify-0.72.0/src/log_rules.cpp:51 .
from: where = rindex(func, ':');
to: where = strrchr(func, ':');

after that, the package 'uncrustify_vendor' could be built sucessfully...

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

No branches or pull requests

3 participants