Add OpenCV to Yocto SDK

Am trying to rebuild the SDK using do_populate_sdk. I keep getting massive, massive errors when bitbake executes do_compile for nativesdk-opencv. As in, generates a log file of 12000+ lines of errors. Here’s an example:

test_lshtable_badarg.cpp:(.text._ZN11opencv_test12_GLOBAL__N_121CV_LshTableBadArgTestD2Ev+0xb): undefined reference to `cvtest::BadArgTest::~BadArgTest()'

They all appear to be “undefined reference” errors.

This looks to me they are all related, and most likely a fundamental assignment, package addition, or other yocto setting is in order, but I am flummoxed as to what that might be. Here’s what I have so far:

I’ve created a bbappend file for opencv recipe and added “nativesdk” to BBCLASSEXTEND. I have not added nativesdk-opencv to TOOLCHAIN_HOST_TASK because the dependency for nativesdk-opencv was generated by gstreamer1.0-plugins-base, which I do have included in TOOLCHAIN_HOST_TASK.

The production image builds fine: everything compiles, including opencv, without errors, but when building sdk, opencv gives me fits.

Any pointers in the right direction?

Just for fun, here is the log of do_compile for the nativesdk-opencv task:

log.do_compile

Hi @grh,

I am unable to reproduce this. I added opencv with IMAGE_INSTALL_append = " opencv " and then build tdx-reference-multimedia-image and the associated SDK without issue.

I am running the HEAD rev of the dunfell-5.x.y branch on an Ubuntu 20.04.2 system.

Can you share any details that differ in your setup?

Drew