<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<span dir="ltr" style="margin-top:0; margin-bottom:0;">If I were you I'd start by running the test suites in your environment and work toward the answer to the question of why example code doesn't compile. If the suites, especially parts with references to the fields that are problems with examples don't build either then I'd turn on the compile options to capture the preprocessed source so you can see the actual class declarations. If the test does build but the example doesn't then finding the declaration difference that explains the failure could shed light on the config/install/compile environment detail that causes the faulty declaration. Tracking down the actual specific hosts that successful tests have completed on might allow you to create that environment in a VM to get by with until the deficit in your desired host is discovered and overcome.</span>
<br><span dir="ltr" style="margin-top:0; margin-bottom:0;">Pete</span>
<br>
<div class="fairemail_quote">
<div dir="ltr">
<p>May 9, 2026 8:29:19 PM Scott Hall <scottghall1@gmail.com>:</p>
</div>
<blockquote style="margin:0;border-left:3px solid #ccc; padding-left:10px;">
<div dir="ltr">
<div dir="ltr">
Here's a link to the tarball of the library: <a href="https://www.kernel.org/pub/software/libs/libgpiod/libgpiod-2.1.3.tar.xz">https://www.kernel.org/pub/software/libs/libgpiod/libgpiod-2.1.3.tar.xz</a>
<div>
<br>
</div>
<div>
- After untarring, go into the resulting libgpiod-2.1.3 directory and follow the README file to build the library:
<br>
\u25cf ./configure --enable-bindings-cxx --prefix=/usr/local
<br>
\u25cf make
<br>
\u25cf sudo make install
<br>
<br>
</div>
<div>
This will generate:
</div>
<div>
\u25a1 Headers have been installed in: /usr/local/include
<br>
gpiodcxx/ gpiod.h gpiod.hpp
<br>
<br>
\u25a1 Libraries have been installed in: /usr/local/lib
<br>
libgpiod.a <a href="http://libgpiodcxx.la">libgpiodcxx.la</a>* libgpiodcxx.so.2@ <a href="http://libgpiod.la">libgpiod.la</a>* libgpiod.so.3@ pkgconfig/
<br>
libgpiodcxx.a libgpiodcxx.so@ libgpiodcxx.so.2.1.0* libgpiod.so@ libgpiod.so.3.1.2*
</div>
<div>
<br>
</div>
<div>
<div>
In the untarred libgpiod-2.1.3 directory you'll find an examples directory for C-language sources (which also don't work) and a bindings/cxx directory of the library classes, and bindings/cxx/examples which is the examples that I am having problems with not compiling.
</div>
<div>
<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">
$ g++ reconfigure_input_to_output.cpp
<br>
reconfigure_input_to_output.cpp:18:22: error: \u2018offset\u2019 in \u2018class gpiod::line\u2019 does not name a type
<br>
18 | const ::gpiod::line::offset line_offset = 5;
<br>
| ^~~~~~
<br>
reconfigure_input_to_output.cpp: In function \u2018int main()\u2019:
<br>
reconfigure_input_to_output.cpp:26:33: error: \u2018class gpiod::chip\u2019 has no member named \u2018prepare_request\u2019
<br>
26 | .prepare_request()
<br>
| ^~~~~~~~~~~~~~~
<br>
reconfigure_input_to_output.cpp:29:40: error: \u2018line_offset\u2019 was not declared in this scope
<br>
29 | line_offset,
<br>
| ^~~~~~~~~~~
<br>
reconfigure_input_to_output.cpp:30:49: error: \u2018line_settings\u2019 is not a member of \u2018gpiod\u2019
<br>
30 | ::gpiod::line_settings().set_direction(
<br>
| ^~~~~~~~~~~~~
<br>
reconfigure_input_to_output.cpp:31:63: error: \u2018gpiod::line::direction\u2019 is not a class, namespace, or enumeration
<br>
31 | ::gpiod::line::direction::INPUT))
<br>
| ^~~~~~~~~
<br>
reconfigure_input_to_output.cpp:37:56: error: \u2018gpiod::line::value\u2019 has not been declared
<br>
37 | ::gpiod::line::value::ACTIVE ?
<br>
| ^~~~~
<br>
reconfigure_input_to_output.cpp:43:44: error: \u2018line_config\u2019 is not a member of \u2018gpiod\u2019
<br>
43 | request.reconfigure_lines(::gpiod::line_config().add_line_settings(
<br>
| ^~~~~~~~~~~
<br>
reconfigure_input_to_output.cpp:45:26: error: \u2018line_settings\u2019 is not a member of \u2018gpiod\u2019
<br>
45 | ::gpiod::line_settings()
<br>
| ^~~~~~~~~~~~~
<br>
reconfigure_input_to_output.cpp:46:55: error: \u2018gpiod::line::direction\u2019 is not a class, namespace, or enumeration
<br>
46 | .set_direction(::gpiod::line::direction::OUTPUT)
<br>
| ^~~~~~~~~
<br>
reconfigure_input_to_output.cpp:47:58: error: \u2018gpiod::line::value\u2019 has not been declared
<br>
47 | .set_output_value(::gpiod::line::value::INACTIVE)));
<br>
| ^~~~~
<br>
reconfigure_input_to_output.cpp:52:56: error: \u2018gpiod::line::value\u2019 has not been declared
<br>
52 | ::gpiod::line::value::ACTIVE ?
<br>
| ^~~~~
</blockquote>
<div>
<br>
</div>
</div>
<div>
As a side note, you'll want to build the library in a Linux environment. Or by adding the --host=aarch64-linux-gnu option to the configure command and putting your crosscompiler toolchain early in your path, you can build the library for crosscompiled systems. Note that it does not build for a MinGW because of missing the ioctl() functionality.
</div>
<div>
<table cellpadding="0" class="gmail-ajC" style="border-spacing:0px;font-size:10.5px;line-height:20px;font-family:"Google Sans",Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-variant-ligatures:no-contextual;">
<tbody>
<tr class="gmail-ajv">
<td colspan="2" tabindex="0" class="gmail-gL" style="padding:2px 0px;vertical-align:top;width:auto;"><span class="gmail-gI" style="vertical-align:top;"><br></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<br>
<div class="gmail_quote gmail_quote_container">
<div dir="ltr" class="gmail_attr">
On Sat, May 9, 2026 at 9:03\u202fAM Pete Soper <<a href="mailto:petesoper@gmail.com">petesoper@gmail.com</a>> wrote:
<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;">
<div>
<span dir="ltr" style="margin-top:0px;margin-bottom:0px;">Send some decent and specific links and compiler messages to the list.</span>
<br><span dir="ltr" style="margin-top:0px;margin-bottom:0px;">Pete</span>
<br>
<div>
<div dir="ltr">
<p>May 9, 2026 1:12:59 AM Scott Hall via TriEmbed <<a href="mailto:triembed@triembed.org" target="_blank">triembed@triembed.org</a>>:</p>
</div>
<blockquote style="margin:0px;border-left:3px solid rgb(204,204,204);padding-left:10px;">
<div dir="auto">
<div>
I am stuck and hope someone in TriEmbed or EMP might know ..
</div>
<div dir="auto">
<br>
</div>
<div dir="auto">
I need to program a Linux process using the libgpiod library's C++ bindings. Trouble is all the examples in the source repo don't compile, and all other forum answers regurgitate the same examples. The same environment's rebuilt commandline utilities work fine.
</div>
<div dir="auto">
<br>
</div>
<div dir="auto">
Does anyone have any working example of reading some GPIO lines, and setting others?
</div>
<div>
<br>
</div>
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
--
</div>
<div>
Scott G. Hall
<br>
Raleigh, NC, USA
<br><a href="mailto:scottghall1@gmail.com" target="_blank">scottghall1@gmail.com</a>
</div><i style="color:rgb(34,34,34);">\u201d</i><i style="color:rgb(34,34,34);">Failure is the opportunity to begin again more intelligently.\u201d -- Henry Ford</i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<div>
<br clear="all">
</div>
<div>
<br>
</div><span class="gmail_signature_prefix">-- </span>
<br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
--
</div>
<div>
Scott G. Hall
<br>
Raleigh, NC, USA
<br><a href="mailto:scottghall1@gmail.com" target="_blank">scottghall1@gmail.com</a>
</div><i style="color:rgb(34,34,34);">\u201d</i><i style="color:rgb(34,34,34);">Failure is the opportunity to begin again more intelligently.\u201d -- Henry Ford</i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</body>
</html>