I am trying to use DS-5 debugger to debug remotely an OpenCV code, that simply reads and displays an image. The target platform is Hardkernel ODROID-XU4 SBC running on Ubuntu 18.04, and the host is a Windows 7 host PC. Everything works just fine and I can debug and step into different regions in my program, however, when I try to display the image in my PC, I get the error depicted in the following debug log
Preparing the debug session # cd "/home/bin" # export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH" # gdbserver :5000 "./opencv_cross_tutorial" Process ./opencv_cross_tutorial created; pid = 2362 Listening on port 5000 Debug session has been started, connecting to gdbserver Remote debugging from host 192.168.1.36 Unable to init server: Could not connect: Connection refused (Display window:2362): Gtk-[1;33mWARNING[0m **: [34m16:50:47.229[0m: cannot open display: Child exited with status 1
I would like to know, how can I resolve this display error and display the image on my host PC, and how can I export the display to the ODROID since it is connected to an LCD screen ?
I have found the solution in the web, logging in my odroid as "root" and executing the following command solved the problem
xhost +SI:localuser:root
I can now view the graphical output of my applications either locally or remotely.