I am testing torizon core from visual studio code and QT example but I have a problem when i add libgpiod to my .pro file or try to include #include <gpiod.h>
At this point:
I have a working qt gui example.
I add devpackage to my torizoncore container; libgpiod-dev:arm64 libgpiod2:arm64
I add libgpiod2 gpiod libgpiod-dev (The last one only to test toradex gpio-toggle.c example)
I build gpio-toggle.c from container terminal and it and gpio toggle works fine in my container (Same that QT App)
Now I try to add toggle to my qt app, but when I add lib to my .pro file using:
LIBS += -L/usr/lib/aarch64-linux-gnu -lgpiod
I get this error from VSCode:
inux-gnu/libQt5Core.so -lpthread
/usr/lib/gcc-cross/aarch64-linux-gnu/10/…/…/…/…/aarch64-linux-gnu/bin/ld: cannot find -lgpiod
collect2: error: ld returned 1 exit status
And if I add #include <gpiod.h> I get:
In file included from gpioTest.cpp:1:
mainwindow.h:16:10: fatal error: gpiod.h: No such file or directory
16 | #include <gpiod.h>
| ^~~~~~~~~
I would humbly suggest you spin up a Ubuntu 20.04 development environment and try to duplicate the issue from there. RPM based distros have weird security and other issues.
If everything works on Ubuntu, stay with Ubuntu.
Most device development shops use Ubuntu or a Debian based distro for development and testing.
Alright after performing the steps I laid out, I’m unfortunately not able to reproduce your issue on my side. For me after adding the link to libgpiod the compilation succeeds with no issue.
As for what could be wrong on your side. Perhaps after adding the packages to devpackages, you didn’t rebuild & reload the SDK container?
I change my development destokp PC with Fedora to my laptop with windows 10 and works fine, I will continue my development on this PC and in the future try to had another test on Fedora to understand where is the problem.
I’m glad to hear it works now, but I would like to understand why this seems to fail on Fedora for whatever reason. If you ever get a chance to look into this please let me know, in case there’s anything we can do to improve our extensions.