avafinger / ov5640

Improved OV5640 for Orange Pi (H3) / Nano Pi (H3) / Banana Pi M64 / Pine64+ / Nano Pi M2/M3 (Experimental)
28 stars 15 forks source link

cap-v4l2 Banana Pi M2 Zero 19.10 build error. #5

Open gavan1 opened 4 years ago

gavan1 commented 4 years ago

With your 19.10 server release.

ubuntu@bpi-m2z:~$ modinfo ov5640
filename:       /lib/modules/5.6.5-server/kernel/drivers/media/i2c/ov5640.ko
license:        GPL
description:    OV5640 MIPI Camera Subdev Driver
alias:          i2c:ov5640
alias:          of:N*T*Covti,ov5640C*
alias:          of:N*T*Covti,ov5640
depends:        videodev,v4l2-fwnode,mc
intree:         Y
name:           ov5640
vermagic:       5.6.5-server SMP mod_unload ARMv7 p2v8
parm:           virtual_channel:MIPI CSI-2 virtual channel (0..3), default 0 (uint)

git clone https://github.com/avafinger/cap-v4l2 cd cap-v4l2 sudo ./install_deps.sh Dependencies are installed with no errors.

When running the build. ./build_script.sh

ubuntu@bpi-m2z:~/cap-v4l2$ ./build_script.sh
Building cap with local header....
In file included from /usr/include/opencv2/core/core.hpp:48,
                 from cap.c:57:
/usr/include/opencv2/core.hpp:49:4: error: #error core.hpp header must be compiled as C++
   49 | #  error core.hpp header must be compiled as C++
      |    ^~~~~
In file included from /usr/include/opencv2/core.hpp:54,
                 from /usr/include/opencv2/core/core.hpp:48,
                 from cap.c:57:
/usr/include/opencv2/core/base.hpp:49:4: error: #error base.hpp header must be compiled as C++
   49 | #  error base.hpp header must be compiled as C++
      |    ^~~~~
In file included from /usr/include/opencv2/core.hpp:54,
                 from /usr/include/opencv2/core/core.hpp:48,
                 from cap.c:57:
/usr/include/opencv2/core/base.hpp:54:10: fatal error: climits: No such file or directory
   54 | #include <climits>
      |          ^~~~~~~~~
compilation terminated.
done!
jagauthier commented 4 years ago

Change the gcc to g++ in the build script.