Error trying to cross-compile ugpio test program
-
I'm trying to compile a really simple c++ test program to make sure my cross-compiling workflow is setup, and I'm getting the error:
mipsel-openwrt-linux-gcc: error: gpioRead.c: No such file or directory
Makefile:9: recipe for target 'gpioRead' failedI tried following the instructions from "From "Cross-Compiling for the Omega" I cannot successfully build the gpioRead example", but I was unsuccessful in getting it to work (libugpio wasn't shipped in the onion source repo, and it never showed up in menuconfig, even after adding the Makefile to package/libs/libugpio)
Any help would be greatly appreciated.
-tlf
-
A missing C file wouldn't typically be the result of a missing library. On a platform like this libraries (to link against) are .a files, and the error messages are from the link stage, not the compile stage.
Your error rather indicates that the build process (probably a Makefile) is pointing to a C source file called gpioRead.c that either didn't get copied to the build machine, or isn't where it is supposed to be. You should examine the Makefile, and also examine the source directory and figure out what the mismatch is.
Also note that if you move code around you can run into different platform specifics - Linux for example cares about capitalization. OSX in contrast preserves it but will match across differences (which can actually cause its own problems). And windows, well, nevermind.
-
Ok, it turns out that I had a typo and it was trying to compile the wrong source file.
However, now I'm getting the error "ugpio/ugpio.h: No such file or directory", which would be caused by the aforementioned problem. How do I get libugpio to show up in "make menuconfig"?
Thanks,
-tlf
-
Nevermind, I figured it out!
cd into the dir where you downloaded lede-project
$ mkdir package/libs/libugpio/
$ cd package/libs/libugpio/
$ wget https://dev.openwrt.org/export/35269/packages/libs/libugpio/Makefile
$ cd -
$ ./scripts/feeds update -a
$ ./scripts/feeds install libugpio
$ make menuconfig
Select Libraries, go down to 'libugpio' and press 'M'
save changes and exit
then build it:
$ make -j4
-
There are a few missing steps in the Onion How To
Once you have used git, open a terminal window in the source folder.
You then need to download the packages as configured in the feeds.conf folder. This is done by
/scripts/feeds update -a
You can then install all the packages
/scripts/feeds update -a
When you execute make menuconfig, you will now find the libugpio option in Library, select it to be included in the build