@Jackdaw
I just tried that and xame a bit further but no completion. I now got
cannot find -lugpio
collect2: error: ld returned 1 exit status
makefile:9: recipe for target 'gpioRead' failed
make: *** [gpioRead] Error 1

On the other hand, if you are not using our Docker Image, you will have to run make menuconfig in the build system to select libugpio package to be compiled and then compile it by running make.

In General you will need to have the external library, for instance libugpio, to be compiled by the Build system before it can be dynamically linked to code that you are trying to cross compile. Above all, I strongly recommend basing your BUild system on our GitHub source repo since it is preconfigured to include the Onion software repo and to build all the libraries that are included on the Omega.

Pavel FYI I followed the instructions for 'cross-compile C Programs' and I used the source repo exactly and the instructions did not say to wget the Makefile and it was not preselected in the .config so I still got the same errors with the ugpio headers when I tried to run the example at the end of those instructions. If you read the "more complex..." section from the link in your post above that I copied below, its says it will all be done if I used that source but I still had to creat the dir, wget the files, select it in .config and then make again. I wouldn't have been able to do that unless I found this post and the example compile would never have worked. Not sure if I did something wrong or its just been missed but thanks for this post, you might want to check the repo for the lib.

"...A Small but Important Note
We keep mentioning that the program will use the ugpio library. In order for this to be possible, the library must first be compiled by LEDE build system.

If you’re using our omega2-source Docker image or building based on our source GitHub repo, you’re all good as it’s selected for compilation by default.

If not, you’ll have to run make menuconfig in the build system to select the libugpio package to be compiled and then compile it by running make.
..."

the instructions did not say to wget the Makefile and it was not preselected in the .config

It was never mentioned that you have to wget the makefile. If you followed this example, you are cloning the GitHub repo to your build system that already contains makefile, xComile.sh and the source code. The tutorial guides you through every step from building the source image and cross-compiling the program.

yeah, that is a good point. there are no links between many of the various examples or tutorials. the original documentation did a good job in referencing and linking the documentation to additional information or another part of the documentation. are these documents able to be edited by the community?

To change the documentation, we welcome pull requests to our Onion-Docs repo on GitHub to make changes that will benefit our entire community. Docs.onion.io is generated form this repo.
Also, if you want to make any additions or changes to conent on our website (e.g. 2 Bullet Tuesday) please send us an email or let us know in the community