Hi All.
This is my first post on the forum.
I recently obtained Raspberrypi 4 B
I have installed
libgpiod-dev Version 1.6.3-1+rpi1+b2
libgpiod Version 1.6.3-1+rpi1+b2
I'm using vcode via ssh and was able to create and compile simple "Hello World" application on Raspberrypi.
I decided to go one step further and wanted to use libgpiod
this is my modified programI'm building it with vcode as i did previously with simple application but with addition of -lgpiodcxx.
And this is the terminal output
Starting build...
/usr/bin/g++ -lgpiodcxx -fdiagnostics-color=always -g /home/user/Dev/HelloWorldCpp/main.cxx -o /home/user/Dev/HelloWorldCpp/main
/usr/bin/ld: /tmp/ccETKSUp.o: in function `main':
/home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::make_chip_iter()'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::begin(gpiod::chip_iter)'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::end(gpiod::chip_iter const&)'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::chip_iter::operator*() const'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:12: undefined reference to `gpiod::chip::name[abi:cxx11]() const'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::chip_iter::operator++()'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::chip_iter::operator!=(gpiod::chip_iter const&) const'
collect2: error: ld returned 1 exit status
Build finished with error(s).
This is my first post on the forum.
I recently obtained Raspberrypi 4 B
I have installed
libgpiod-dev Version 1.6.3-1+rpi1+b2
libgpiod Version 1.6.3-1+rpi1+b2
I'm using vcode via ssh and was able to create and compile simple "Hello World" application on Raspberrypi.
I decided to go one step further and wanted to use libgpiod
this is my modified program
Code:
#include <iostream>#include <iomanip>#include <gpiod.hpp>int main(int argc, char **argv){std::cout << "Hello World\n";try { for (const auto &chip : gpiod::make_chip_iter()) { std::cout << chip.name(); } } catch (const std::exception &e) { std::cerr << "Error: " << e.what() << std::endl; return 1; }return 0;}
And this is the terminal output
Starting build...
/usr/bin/g++ -lgpiodcxx -fdiagnostics-color=always -g /home/user/Dev/HelloWorldCpp/main.cxx -o /home/user/Dev/HelloWorldCpp/main
/usr/bin/ld: /tmp/ccETKSUp.o: in function `main':
/home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::make_chip_iter()'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::begin(gpiod::chip_iter)'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::end(gpiod::chip_iter const&)'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::chip_iter::operator*() const'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:12: undefined reference to `gpiod::chip::name[abi:cxx11]() const'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::chip_iter::operator++()'
/usr/bin/ld: /home/user/Dev/HelloWorldCpp/main.cxx:11: undefined reference to `gpiod::chip_iter::operator!=(gpiod::chip_iter const&) const'
collect2: error: ld returned 1 exit status
Build finished with error(s).
Statistics: Posted by koirat — Wed Aug 28, 2024 6:50 pm