Solved - Segmentation fault (core dumped) - When running simple OpenCV compiled code

Yes, I realized that.

I have also tried doing:

./opencv_1 lena.jpg

and now get this error:

Abort trap (core dumped)

Here is the gdb back trace debugging:

GNU gdb (GDB) 12.1 [GDB v12.1 for FreeBSD]
Reading symbols from /home/user/OpenCV_1/opencv_1...
[New LWP 128661]

warning: Unexpected size of section `.reg-xstate/128661' in core file.
Core was generated by `./opencv_1 lena.jpg'.
Program terminated with signal SIGABRT, Aborted.
Sent by thr_kill() from pid 3967 and user 1001.

warning: Unexpected size of section `.reg-xstate/128661' in core file.
#0  0x0000000804cb433a in thr_kill () from /lib/libc.so.7

(gdb) bt

#0  0x0000000804cb433a in thr_kill () at /lib/libc.so.7
#1  0x0000000804c2cc74 in raise () at /lib/libc.so.7
#2  0x0000000804cde109 in abort () at /lib/libc.so.7
#3  0x0000000800febe69 in  () at /lib/libcxxrt.so.1
#4  0x00000008041e98f5 in cv::error(cv::Exception const&) () at /usr/local/lib/libopencv_core.so.405
#5  0x00000008041e91a2 in cv::error(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char const*, char const*, int) ()
    at /usr/local/lib/libopencv_core.so.405
#6  0x0000000800db7417 in cv::namedWindow(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) () at /usr/local/lib/libopencv_highgui.so.405
#7  0x00000000002027a9 in main(int, char**) (argc=2, argv=0x7fffffffe478) at opencv_1.cpp:28

Trace shows exception was raised in cv::namedWindow()

I think OpenCV have some trouble to display the image, like literally. Because it could be that OpenCV does not know how to access the window/desktop server to display the image on the KDE desktop environment I am using.

Does OpenCV works out of the box for FreeBSD 13.1 using KDE5 plasma desktop environment, does it need like GTK or QT to work?