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

Compilation failed for Raspberry Pi with undefined reference to `__atomic_store_8' #1296

Closed
Katawann opened this issue Jan 29, 2021 · 3 comments
Labels

Comments

@Katawann
Copy link
Contributor

When I try to compile MAVSDK C++ on my Raspberry Pi (RPi 3B+ armv7l with Raspbian GNU/Linux 10 buster), it fails with the v0.35.1 but not with the v0.33.1

With the v0.35.1, it finishes with the error below:

$ cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -DENABLE_MAVLINK_PASSTHROUGH=ON -DBUILD_TEST=ON -Bbuild -H.

...

-- Build files have been written to: /home/pi/libs/MAVSDK/build
$ sudo cmake --build build

...

[ 39%] Building CXX object src/CMakeFiles/unit_tests_runner.dir/plugins/telemetry/math_conversions_test.cpp.o
[ 40%] Linking CXX executable unit_tests_runner
/usr/bin/ld: core/libmavsdk.so.0.35.1: undefined reference to `__atomic_store_8'
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/unit_tests_runner.dir/build.make:349: src/unit_tests_runner] Error 1
make[1]: *** [CMakeFiles/Makefile2:127: src/CMakeFiles/unit_tests_runner.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
@Katawann Katawann changed the title Compilation failed for Raspberry pi with undefined reference to `__atomic_store_8' Compilation failed for Raspberry Pi with undefined reference to `__atomic_store_8' Jan 29, 2021
@julianoes julianoes added the bug label Feb 1, 2021
@julianoes
Copy link
Collaborator

You need something like

target_link_libraries(mavsdk PRIVATE atomic)
but it should only be added for armv6 and armv7 targets, so it would need some if to check for that. Would you mind trying that out and making a pull request once you find a solution that works?

@Katawann
Copy link
Contributor Author

Katawann commented Feb 1, 2021

Done ! I don't have the issue anymore with the check thank you

@Katawann Katawann closed this as completed Feb 1, 2021
@JonasVautherin
Copy link
Collaborator

Thank you for the contribution!

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