flex-builder: build OpenCV 4.10.0 undefined reference to gtk functions

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

flex-builder: build OpenCV 4.10.0 undefined reference to gtk functions

2,173 Views
noahw
Contributor III

I am trying to build OpenCV app component libs for LS1028ARDB using flex-builder:

bld -c opencv -r ubuntu:desktop

My sdk.yml file has the following entry:

opencv:
branch: 4.10.0_imx
 
 

I have modified my packages/apps/eiq/opencv.mk to look like this:

.PHONY: opencv
opencv: dependency
ifeq ($(CONFIG_EIQ_OPENCV), "y")
ifeq ($(DESTARCH),arm64)
@[ $(DISTROTYPE) != ubuntu ] && exit || \
$(call fbprint_b,"OpenCV") && \
$(call fetch-git-tree,opencv,apps/eiq) && \
$(call fetch-git-tree,armcl,apps/eiq) && \
mkdir -p $(eIQDIR)/opencv/build && \
cd $(eIQDIR)/opencv/build && \
mkdir -p $(eIQDESTDIR)/usr/local/OpenCV && \
export DESTDIR=$(eIQDESTDIR) && \
CXX=$(CROSS_COMPILE)g++ CC=$(CROSS_COMPILE)gcc \
export PKG_CONFIG_FOUND=TRUE && \
export PKG_CONFIG_LIBDIR=$(RFSDIR)/usr/lib/aarch64-linux-gnu/pkgconfig && \
export PKG_CONFIG_PATH=$(RFSDIR)/usr/share/pkgconfig && \
export PKG_CONFIG_EXECUTABLE=$(RFSDIR)/usr/bin/pkg-config && \
cmake -DCMAKE_TOOLCHAIN_FILE=$(eIQDIR)/opencv/platforms/linux/aarch64-gnu.toolchain.cmake \
-DBUILD_opencv_gapi=OFF \
-DBUILD_GTHREAD=OFF \
-DBUILD_GLIB=OFF \
-DBUILD_GTK2=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DJPEG_LIBRARY=$(RFSDIR)/usr/lib/aarch64-linux-gnu/libjpeg.so \
-DPNG_LIBRARY=$(RFSDIR)/usr/lib/aarch64-linux-gnu/libpng.so \
-DGTK2_LIBRARIES=$(RFSDIR)/usr/lib/aarch64-linux-gnu/libgtk-x11-2.0.so \
-DGTHREAD_LIBRARIES=$(RFSDIR)/usr/lib/aarch64-linux-gnu/libgthread-2.0.so \
-DBUILD_opencv_python2=OFF \
-DBUILD_opencv_python3=OFF -DWITH_GTK=ON -DWITH_GTK_2_X=ON -DWITH_FFMPEG=ON \
-DCMAKE_SYSROOT=$(RFSDIR) -DZLIB_LIBRARY=$(RFSDIR)/lib/aarch64-linux-gnu/libz.so \
-DWITH_OPENCL=OFF -DBUILD_JASPER=ON -DINSTALL_TESTS=ON \
-DBUILD_EXAMPLES=ON -DBUILD_opencv_apps=ON \
-DPYTHON_DEFAULT_EXECUTABLE=/usr/bin/python3 \
-DPYTHON3_EXECUTABLE=/usr/bin/python3 -DCMAKE_INSTALL_PREFIX=/usr/local \
-DPYTHON3_INCLUDE_DIR=$(RFSDIR)/usr/include/python3.8 \
-DPYTHON3_LIBRARY=$(RFSDIR)/usr/lib/aarch64-linux-gnu/libpython3.8.so \
-DPYTHON3_NUMPY_INCLUDE_DIRS=$(RFSDIR)/usr/lib/python3/dist-packages/numpy/core/include \
-DPYTHON3_PACKAGES_PATH=/usr/local/lib -DENABLE_VFPV3=OFF -DENABLE_NEON=ON \
-DFFMPEG_INCLUDE_DIRS=$(RFSDIR)/usr/include/aarch64-linux-gnu \
-DOPENCV_EXTRA_CXX_FLAGS="-I$(RFSDIR)/usr/include/gtk-2.0 -I$(RFSDIR)/usr/include/cairo \
-I$(RFSDIR)/usr/lib/aarch64-linux-gnu/glib-2.0/include -I$(RFSDIR)/usr/include/pango-1.0 \
-I$(RFSDIR)/usr/lib/aarch64-linux-gnu/gtk-2.0/include -I$(RFSDIR)/usr/include/gdk-pixbuf-2.0 \
-I$(RFSDIR)/usr/include/glib-2.0 -I$(RFSDIR)/usr/include/harfbuzz \
-I$(RFSDIR)/usr/include/atk-1.0 -I$(RFSDIR)/usr/include/aarch64-linux-gnu \
-I$(eIQDIR)/armcl/include -I$(RFSDIR)/usr/include/opencv4 -L$(RFSDIR)/usr/lib/aarch64-linux-gnu/ -lgtk-x11-2.0 -lgthread-2.0 -lglib-2.0" .. && \
make -j$(JOBS) && make install && \
cp -f bin/* $(eIQDESTDIR)/usr/local/bin && \
cp -f ../samples/dnn/models.yml $(eIQDESTDIR)/usr/local/OpenCV/ && \
cp -r ../samples/data $(eIQDESTDIR)/usr/local/OpenCV && \
cd $(eIQDESTDIR)/usr/local/lib/cv2/python-3.8 && \
mv cv2.cpython-38-x86_64-linux-gnu.so cv2.cpython-38-aarch64-linux-gnu.so && cd - && \
$(call fbprint_d,"OpenCV")
endif
endif
 
 
 
 
There seems to be trouble linking with the glib library. I am getting following complaints from the linker:
 
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o: in function `cvImageWidget_class_init(void*, void*)':
window_gtk.cpp:(.text._ZL24cvImageWidget_class_initPvS_+0x14): undefined reference to `g_type_class_peek'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: window_gtk.cpp:(.text._ZL24cvImageWidget_class_initPvS_+0x1c): undefined reference to `g_type_check_class_cast'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o: in function `icvOnTrackbar(_GtkWidget*, void*)':
window_gtk.cpp:(.text._ZL13icvOnTrackbarP10_GtkWidgetPv+0x1c): undefined reference to `g_type_check_instance_cast'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o: in function `icvWindowThreadLoop(void*)':
window_gtk.cpp:(.text._ZL19icvWindowThreadLoopPv+0x28): undefined reference to `g_usleep'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: window_gtk.cpp:(.text._ZL19icvWindowThreadLoopPv+0x2c): undefined reference to `g_thread_yield'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: window_gtk.cpp:(.text._ZL19icvWindowThreadLoopPv+0x58): undefined reference to `g_usleep'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: window_gtk.cpp:(.text._ZL19icvWindowThreadLoopPv+0x5c): undefined reference to `g_thread_yield'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o: in function `cvImageWidgetSetImage(_CvImageWidget*, void const*)':
window_gtk.cpp:(.text._ZL21cvImageWidgetSetImageP14_CvImageWidgetPKv+0x188): undefined reference to `g_type_check_instance_cast'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: window_gtk.cpp:(.text._ZL21cvImageWidgetSetImageP14_CvImageWidgetPKv+0x27c): undefined reference to `g_type_check_instance_cast'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o: in function `cvImageWidget_size_request(_GtkWidget*, _GtkRequisition*)':
window_gtk.cpp:(.text._ZL26cvImageWidget_size_requestP10_GtkWidgetP15_GtkRequisition+0x24): undefined reference to `g_type_check_instance_cast'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: window_gtk.cpp:(.text._ZL26cvImageWidget_size_requestP10_GtkWidgetP15_GtkRequisition+0x9c): undefined reference to `g_type_register_static_simple'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o: in function `resizeWindow_(std::shared_ptr<CvWindow> const&, int, int)':
window_gtk.cpp:(.text._ZL13resizeWindow_RKSt10shared_ptrI8CvWindowEii+0x4c): undefined reference to `g_type_check_instance_cast'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: window_gtk.cpp:(.text._ZL13resizeWindow_RKSt10shared_ptrI8CvWindowEii+0x68): undefined reference to `g_type_check_instance_cast'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: window_gtk.cpp:(.text._ZL13resizeWindow_RKSt10shared_ptrI8CvWindowEii+0x80): undefined reference to `g_type_check_instance_cast'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: window_gtk.cpp:(.text._ZL13resizeWindow_RKSt10shared_ptrI8CvWindowEii+0xf0): undefined reference to `g_type_register_static_simple'
/usr/lib/gcc-cross/aarch64-linux-gnu/9/../../../../aarch64-linux-gnu/bin/ld: CMakeFiles/opencv_highgui.dir/src/window_gtk.cpp.o: in function `cvImageWidget_set_size(_GtkWidget*, int, int)':
 
...
etc
 
I have the glib, gtk, gthread, etc. libs in my rfs /usr/lib/aarch64-linux-gnu folder.
 
Any ideas?
0 Kudos
Reply
10 Replies

2,140 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please install libgtk2.0-0 in your build environment.

In your LSDK 21.08 host build environment, please execute the following command:

$ sudo chroot build/rfs/rootfs_lsdk2108_ubuntu_main_arm64/

Then run the following command.

/# sudo apt-get install libgtk2.0-0

/# exit

0 Kudos
Reply

2,129 Views
noahw
Contributor III

I believe I already have libgtk-2.0-0 installed in the rootfs.

Here's the output of that apt-get command:

root@aen071:/# sudo apt-get install libgtk2.0-0
Unknown host IFA type: 9
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgtk2.0-0 is already the newest version (2.24.32-4ubuntu4.1).
/bin/sh: 1: cannot create /dev/null: Permission denied
/bin/sh: 1: cannot create /dev/null: Permission denied
0 upgraded, 0 newly installed, 0 to remove and 562 not upgraded.
/bin/sh: 1: cannot create /dev/null: Permission denied
/bin/sh: 1: cannot create /dev/null: Permission denied

 

Also, if I list the gtk-related libs, I get this:

root@aen071:/# ll /usr/lib/aarch64-linux-gnu/ | grep gtk
drwxr-xr-x 5 root root 4096 Feb 25 23:54 gtk-2.0/
drwxr-xr-x 4 root root 4096 Aug 26 2021 gtk-3.0/
lrwxrwxrwx 1 root root 25 Jul 6 2021 libavahi-ui-gtk3.so.0 -> libavahi-ui-gtk3.so.0.1.4
-rw-r--r-- 1 root root 52472 Jul 6 2021 libavahi-ui-gtk3.so.0.1.4
lrwxrwxrwx 1 root root 25 Jun 21 2019 libcanberra-gtk3.so.0 -> libcanberra-gtk3.so.0.1.9
-rw-r--r-- 1 root root 18200 Jun 21 2019 libcanberra-gtk3.so.0.1.9
lrwxrwxrwx 1 root root 32 Jan 9 2020 libchamplain-gtk-0.12.so.0 -> libchamplain-gtk-0.12.so.0.11.10
-rw-r--r-- 1 root root 14104 Jan 9 2020 libchamplain-gtk-0.12.so.0.11.10
lrwxrwxrwx 1 root root 23 Sep 24 2020 libcheese-gtk.so.25 -> libcheese-gtk.so.25.1.4
-rw-r--r-- 1 root root 55144 Sep 24 2020 libcheese-gtk.so.25.1.4
lrwxrwxrwx 1 root root 29 Dec 23 2018 libclutter-gtk-1.0.so.0 -> libclutter-gtk-1.0.so.0.800.4
-rw-r--r-- 1 root root 59240 Dec 23 2018 libclutter-gtk-1.0.so.0.800.4
lrwxrwxrwx 1 root root 22 Aug 21 2019 libcolord-gtk.so.1 -> libcolord-gtk.so.1.0.3
-rw-r--r-- 1 root root 30488 Aug 21 2019 libcolord-gtk.so.1.0.3
lrwxrwxrwx 1 root root 26 Apr 6 2020 libdbusmenu-gtk3.so.4 -> libdbusmenu-gtk3.so.4.0.12
-rw-r--r-- 1 root root 81896 Apr 6 2020 libdbusmenu-gtk3.so.4.0.12
lrwxrwxrwx 1 root root 30 Jun 4 2021 libgnome-autoar-gtk-0.so.0 -> libgnome-autoar-gtk-0.so.0.0.0
-rw-r--r-- 1 root root 18200 Jun 4 2021 libgnome-autoar-gtk-0.so.0.0.0
drwxr-xr-x 2 root root 4096 Feb 25 23:53 libgtk2.0-0/
drwxr-xr-x 2 root root 4096 Aug 26 2021 libgtk-3-0/
lrwxrwxrwx 1 root root 21 May 8 2020 libgtk-3.so.0 -> libgtk-3.so.0.2404.16
-rw-r--r-- 1 root root 8122272 May 8 2020 libgtk-3.so.0.2404.16
lrwxrwxrwx 1 root root 21 Mar 21 2020 libgtkmm-3.0.so.1 -> libgtkmm-3.0.so.1.1.0
-rw-r--r-- 1 root root 5789808 Mar 21 2020 libgtkmm-3.0.so.1.1.0
lrwxrwxrwx 1 root root 27 Mar 10 2020 libgtksourceview-4.so.0 -> libgtksourceview-4.so.0.0.0
-rw-r--r-- 1 root root 645208 Mar 10 2020 libgtksourceview-4.so.0.0.0
lrwxrwxrwx 1 root root 23 Mar 22 2020 libgtk-vnc-2.0.so.0 -> libgtk-vnc-2.0.so.0.0.2
-rw-r--r-- 1 root root 206696 Mar 22 2020 libgtk-vnc-2.0.so.0.0.2
lrwxrwxrwx 1 root root 27 Jul 15 2024 libgtk-x11-2.0.so -> libgtk-x11-2.0.so.0.2400.32
lrwxrwxrwx 1 root root 27 Jul 15 2024 libgtk-x11-2.0.so.0 -> libgtk-x11-2.0.so.0.2400.32
-rw-r--r-- 1 root root 4596776 Jul 15 2024 libgtk-x11-2.0.so.0.2400.32
lrwxrwxrwx 1 root root 35 Jul 27 2021 libjavascriptcoregtk-4.0.so.18 -> libjavascriptcoregtk-4.0.so.18.18.7
-rw-r--r-- 1 root root 23811040 Jul 27 2021 libjavascriptcoregtk-4.0.so.18.18.7
lrwxrwxrwx 1 root root 27 Mar 10 2020 libpeas-gtk-1.0.so.0 -> libpeas-gtk-1.0.so.0.2600.0
-rw-r--r-- 1 root root 59320 Mar 10 2020 libpeas-gtk-1.0.so.0.2600.0
lrwxrwxrwx 1 root root 32 Apr 11 2020 libspice-client-gtk-3.0.so.5 -> libspice-client-gtk-3.0.so.5.0.0
-rw-r--r-- 1 root root 271104 Apr 11 2020 libspice-client-gtk-3.0.so.5.0.0
lrwxrwxrwx 1 root root 28 Jul 27 2021 libwebkit2gtk-4.0.so.37 -> libwebkit2gtk-4.0.so.37.53.4
-rw-r--r-- 1 root root 55885408 Jul 27 2021 libwebkit2gtk-4.0.so.37.53.4
drwxr-xr-x 3 root root 4096 Aug 26 2021 webkit2gtk-4.0/

 

You'll see libgtk-x11-2.0.so is already there.

 

Also:

root@aen071:/# ll /usr/lib/aarch64-linux-gnu/ | grep glib
drwxr-xr-x 3 root root 4096 Feb 28 00:03 glib-2.0/
lrwxrwxrwx 1 root root 27 Apr 5 2020 libappstream-glib.so.8 -> libappstream-glib.so.8.0.10
-rw-r--r-- 1 root root 402864 Apr 5 2020 libappstream-glib.so.8.0.10
lrwxrwxrwx 1 root root 22 Jul 6 2021 libavahi-glib.so.1 -> libavahi-glib.so.1.0.2
-rw-r--r-- 1 root root 14408 Jul 6 2021 libavahi-glib.so.1.0.2
lrwxrwxrwx 1 root root 23 Dec 9 2019 libdbus-glib-1.so.2 -> libdbus-glib-1.so.2.3.4
-rw-r--r-- 1 root root 161648 Dec 9 2019 libdbus-glib-1.so.2.3.4
lrwxrwxrwx 1 root root 26 Apr 6 2020 libdbusmenu-glib.so.4 -> libdbusmenu-glib.so.4.0.12
-rw-r--r-- 1 root root 114056 Apr 6 2020 libdbusmenu-glib.so.4.0.12
lrwxrwxrwx 1 root root 24 Mar 20 2020 libgeocode-glib.so.0 -> libgeocode-glib.so.0.0.0
-rw-r--r-- 1 root root 108456 Mar 20 2020 libgeocode-glib.so.0.0.0
lrwxrwxrwx 1 root root 28 Mar 2 2020 libgit2-glib-1.0.so.0 -> libgit2-glib-1.0.so.0.2800.0
-rw-r--r-- 1 root root 276328 Mar 2 2020 libgit2-glib-1.0.so.0.2800.0
-rw-r--r-- 1 root root 2276046 Nov 13 19:12 libglib-2.0.a
lrwxrwxrwx 1 root root 16 Nov 13 19:12 libglib-2.0.so -> libglib-2.0.so.0
lrwxrwxrwx 1 root root 23 Nov 13 19:12 libglib-2.0.so.0 -> libglib-2.0.so.0.6400.6
-rw-r--r-- 1 root root 1220208 Nov 13 19:12 libglib-2.0.so.0.6400.6
lrwxrwxrwx 1 root root 22 Mar 29 2020 libglibmm-2.4.so.1 -> libglibmm-2.4.so.1.3.0
-rw-r--r-- 1 root root 555224 Mar 29 2020 libglibmm-2.4.so.1.3.0
lrwxrwxrwx 1 root root 42 Mar 29 2020 libglibmm_generate_extra_defs-2.4.so.1 -> libglibmm_generate_extra_defs-2.4.so.1.3.0
-rw-r--r-- 1 root root 175208 Mar 29 2020 libglibmm_generate_extra_defs-2.4.so.1.3.0
lrwxrwxrwx 1 root root 21 Mar 13 2020 libical-glib.so.3 -> libical-glib.so.3.0.8
-rw-r--r-- 1 root root 423704 Mar 13 2020 libical-glib.so.3.0.8
lrwxrwxrwx 1 root root 27 Apr 6 2020 libjson-glib-1.0.so.0 -> libjson-glib-1.0.so.0.400.4
-rw-r--r-- 1 root root 165736 Apr 6 2020 libjson-glib-1.0.so.0.400.4
lrwxrwxrwx 1 root root 21 Feb 27 2020 libmbim-glib.so.4 -> libmbim-glib.so.4.4.2
-rw-r--r-- 1 root root 359944 Feb 27 2020 libmbim-glib.so.4.4.2
lrwxrwxrwx 1 root root 19 Apr 10 2020 libmm-glib.so.0 -> libmm-glib.so.0.5.0
-rw-r--r-- 1 root root 917632 Apr 10 2020 libmm-glib.so.0.5.0
lrwxrwxrwx 1 root root 29 Sep 23 2020 libpackagekit-glib2.so.18 -> libpackagekit-glib2.so.18.1.3
-rw-r--r-- 1 root root 389208 Sep 23 2020 libpackagekit-glib2.so.18.1.3
lrwxrwxrwx 1 root root 25 Mar 27 2020 libpoppler-glib.so.8 -> libpoppler-glib.so.8.15.0
-rw-r--r-- 1 root root 374632 Mar 27 2020 libpoppler-glib.so.8.15.0
lrwxrwxrwx 1 root root 31 May 25 2021 libpulse-mainloop-glib.so.0 -> libpulse-mainloop-glib.so.0.0.5
-rw-r--r-- 1 root root 18408 May 25 2021 libpulse-mainloop-glib.so.0.0.5
lrwxrwxrwx 1 root root 20 Mar 26 2020 libqmi-glib.so.5 -> libqmi-glib.so.5.6.0
-rw-r--r-- 1 root root 2653952 Mar 26 2020 libqmi-glib.so.5.6.0
lrwxrwxrwx 1 root root 22 Nov 12 2020 libsnapd-glib.so.1 -> libsnapd-glib.so.1.0.0
-rw-r--r-- 1 root root 341864 Nov 12 2020 libsnapd-glib.so.1.0.0
lrwxrwxrwx 1 root root 33 Apr 11 2020 libspice-client-glib-2.0.so.8 -> libspice-client-glib-2.0.so.8.6.0
-rw-r--r-- 1 root root 1131432 Apr 11 2020 libspice-client-glib-2.0.so.8.6.0
lrwxrwxrwx 1 root root 23 Dec 10 2019 libupower-glib.so.3 -> libupower-glib.so.3.0.1
-rw-r--r-- 1 root root 163112 Dec 10 2019 libupower-glib.so.3.0.1
lrwxrwxrwx 1 root root 25 Mar 23 2020 libvtkalglib-6.3.so.6.3 -> libvtkalglib-6.3.so.6.3.0
-rw-r--r-- 1 root root 117600 Mar 23 2020 libvtkalglib-6.3.so.6.3.0

 

 

and for gthread:

root@aen071:/# ll /usr/lib/aarch64-linux-gnu/ | grep gthread
-rw-r--r-- 1 root root 2702 Nov 13 19:12 libgthread-2.0.a
lrwxrwxrwx 1 root root 19 Nov 13 19:12 libgthread-2.0.so -> libgthread-2.0.so.0
lrwxrwxrwx 1 root root 26 Nov 13 19:12 libgthread-2.0.so.0 -> libgthread-2.0.so.0.6400.6
-rw-r--r-- 1 root root 6072 Nov 13 19:12 libgthread-2.0.so.0.6400.6

 

 

Does this look right?

0 Kudos
Reply

2,086 Views
yipingwang
NXP TechSupport
NXP TechSupport

In my build environment, there is no file libgtk-x11-2.0.so, I only have libgtk-x11-2.0.so.0, please do the following modification in packages/apps/eiq/opencv.mk

-DGTK2_LIBRARIES=$(RFSDIR)/usr/lib/aarch64-linux-gnu/libgtk-x11-2.0.so 

Modify to:

-DGTK2_LIBRARIES=$(RFSDIR)/usr/lib/aarch64-linux-gnu/libgtk-x11-2.0.so.0

0 Kudos
Reply

2,043 Views
noahw
Contributor III

I tried this modification but get the same result. I believe the compiler somehow isn't finding the libgtk so files...not sure how.

 

And I know these so files contain the correct symbols, like g_type_class_peek, etc.:

root@aen071:/# nm -gD /usr/lib/aarch64-linux-gnu/libgtk-x11-2.0.so | grep class_peek
U g_type_class_peek
U g_type_class_peek_parent

 

Any other ideas?

Thanks

0 Kudos
Reply

2,022 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please check file components/apps/eiq/opencv/build/CMakeVars.txt, whether the following is defined.

GTK2_gtk+-2.0_FOUND=1

GTK2_STATIC_LIBRARY_DIRS=/usr/lib/aarch64-linux-gnu

HAVE_GTK2=1

HAVE_GTK=TRUE

0 Kudos
Reply

1,996 Views
noahw
Contributor III

Yes, all of those are defined.

0 Kudos
Reply

1,914 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please remove "-lgtk-x11-2.0" from packages/apps/eiq/opencv.mk, then remove folder components/apps/eiq/opencv/build/, and rebuild opencv with command:

$ flex-builder -c opencv -m ls1028ardb

I have verified your build configuration on my host PC, I have passed the compilation without any problem.

0 Kudos
Reply

1,834 Views
noahw
Contributor III

Hmm, I removed these things and ran your command but still having the same errors.

In your sdk.yml file, are you also pulling branch 4.10.0_imx?

opencv:
branch4.10.0_imx
 
 
Also, could you explain the difference between running 
flex-builder -c opencv -m ls1028ardb
vs.
flex-builder -c opencv -r ubuntu:desktop
?
0 Kudos
Reply

1,782 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please install libgtk2.0-0 in your build environment.

In your LSDK 21.08 host build environment, please execute the following command:

$ sudo chroot build/rfs/rootfs_lsdk2108_ubuntu_desktop_arm64/

Then run the following command.

/# sudo apt-get install libgtk2.0-0

/# exit

Then run command:

$ flex-builder -c opencv -r ubuntu:desktop

0 Kudos
Reply

1,786 Views
yipingwang
NXP TechSupport
NXP TechSupport

I used the same configuration(4.10.0_imx) described by you.

No difference between the following two commands.

flex-builder -c opencv -m ls1028ardb
vs.
flex-builder -c opencv -r ubuntu:desktop
 
Would you please remove folder components/apps/eiq/opencv/build/, and rebuild opencv with the above command.

 

0 Kudos
Reply