I have a SD card that works fine on raspberry pi 4. Raspbian Buster(Version: September 2019) was installed into the SD card and I did a project which is including boost, opencv, raspi-cam libraries.

After that, I took output of executable to throw in Raspberry Pi zero. Btw,executable works fine in raspberry 4.

Whenever I transfer it to the raspberry pi zero. I get segmentation fault when trying to run executable.

I also succeeded on running projects in rpi zero which compiled on rpi4 using boost and opencv.

2 Answers 2


Raspbian on Raspberry Pi 4 uses ARMv7 binaries while Pi Zero uses ARMv6hf. You can easily use ARMv6hf binaries on ARMv7 CPUs but not the other way around. So build your libraries on your target platform or use cross compilation.

  • but i did projects.One of them,contains only the boost library and output the version of the boost library.Other,contains only the openCV library and output read image and save image.I compile them at raspberry pi 4 and also worked at raspberry pi zero when i throw to zero. Commented Oct 15, 2019 at 14:18
  • Then you were lucky that the binary did not use ARMv7 instructions.
    – kwasmich
    Commented Oct 15, 2019 at 14:22
  • is it just about luck ? :)) Commented Oct 15, 2019 at 14:36
  • ARMv6 is a subset of ARMv7 - or other way around ARMv7 is a superset of ARMv6. They introduced new specialized instructions that not necessarily affect every application. Also the compiler flags hugely influence the generated binary code.
    – kwasmich
    Commented Oct 15, 2019 at 14:44

From this repository https://github.com/raspberrypi/tools use arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf to your makefile

  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Mar 30, 2023 at 17:13
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Chenmunka
    Commented Mar 30, 2023 at 17:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.