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.


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. Oct 15 '19 at 14:18
  • Then you were lucky that the binary did not use ARMv7 instructions.
    – kwasmich
    Oct 15 '19 at 14:22
  • is it just about luck ? :)) Oct 15 '19 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
    Oct 15 '19 at 14:44
  • okay,thank you for idea. Oct 15 '19 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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