Visual Studio Debugging OpenCV and Raspberry PI 4B Linux GUI RRS feed

  • Question

  • Hello,
    I hope that you can help me.
    I’ve been through many blogs and tutorials from Microsoft concerning debugging Linux from Visual Studio 2017/2019/2019 Community.
    From a Windows 10 computer using Visual Studio Community 2019, I was able to successfully get a Raspberry PI 4 ARM test C++ program compiling and debugging with the latest Raspberry PI Debian Buster-Raspian operating system. I was able to successfully do source level debugging from within Visual Studio. From within Visual Studio, I was also able to successfully do source level debugging for my test C++ program and step into the OpenCV source code, which was compiled with the debug flag.
    The problem that I’m facing is if I use a GUI for OpenCV in my test C++ program; the program will always crash in the debugger. I can successfully run the program outside of the Visual Studio environment on the Raspberry PI 4 without crashing.
    I did two separate, successful compilation of OpenCV; one with the GTK; and the other with Qt support for the GUI. In both cases the program will successfully run outside of the debugger. However, when I try to run it in the debugger using any of the GUI command, the program will crash. For the GTK, it crashes inside the gtk_init() function. For Qt, it crashes inside the Qt initialization function.
    My test C++ program can successfully capture frames from a web cam and save them to the SD card with and without the GUI on the Raspberry PI 4; coded and compiled with Visual Studio Community 2019. I can debug it without the GUI inside Visual Studio. However, it will crash when the GUI is enabled and I try to debug it inside Visual Studio.
    Are you aware of any compatibility issues when debugging a GUI application?
    Do you have any working examples of compiling a GUI application from Visual Studio and debugging it on the Raspberry PI 4?
    Do you have any detailed tutorials for such?
    I’ve kept all OSes and toolchains up to date during this testing.
    Your prompt response will greatly be appreciated.
    Wednesday, July 15, 2020 5:01 AM

All replies