I work with ODROID-C2. I have installed the wiringPi library followed the instructions (from page https://wiki.odroid.com/odroid-c2/application_note/gpio/wiringpi):
$ sudo apt install git
$ git clone https://github.com/hardkernel/wiringPi
$ cd wiringPi
$ sudo ./build
and finaly I get the information "All Done".
However during the instalation among different common warnings (e.g. "ignoring return value of ...
") I get the following warning (e.g.):
"implicit declatration of function 'pinMode' [-Wimplicit-function-declaration]
".
Similar warnings related to the diffrent functions appear many times during library instalation.
After instalation the usage of the command gpio readall
allows to get the whole map of pins. Moreover, if I add the library to my program in C
(#include <wiringPi.h>
), the program is compiled successfully. However, when I use the command from library (e.g. wiringPiSetup();
), the compilation fails and the following error appears:
16: error: 'wiringPiSetup' was not declared in this scope
.
My simple code bellow:
#include <unistd.h>
#include <wiringPi.h>
#include <cstdio>
using namespace std;
int main (void)
{
wiringPiSetup();
while (1)
{
printf("*** T E S T ***\n");
usleep(100000);
}
}
How can I fix the problem with wiringPi library?