Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /usr/bin/ld: /tmp/ccK4sGN3.o: in function `main':
- OutputGPIO.c:(.text+0x20): undefined reference to `gpio_open'
- /usr/bin/ld: OutputGPIO.c:(.text+0x42): undefined reference to `gpio_write'
- /usr/bin/ld: OutputGPIO.c:(.text+0x4e): undefined reference to `gpio_set_direction_output'
- /usr/bin/ld: OutputGPIO.c:(.text+0x64): undefined reference to `gpio_close'
- collect2: error: ld returned 1 exit status
- # FROM
- // basic example for handling input change events
- #include "sysfs-gpio.h"
- #include <stdio.h>
- int main()
- {
- struct Gpio gpio = GPIO_INITIALIZER;
- gpio_open( &gpio, "/sys/class/gpio/gpio51", GPIO_RDWR );
- int const timeout_ms = 3000; // -1 = no timeout
- if ( gpio_open_output ) {
- printf( "%d\n", &gpio);
- gpio_write( &gpio, 0 );
- gpio_set_direction_output(&gpio, 1);
- }
- else {
- ( ( &gpio, timeout_ms ) );
- }
- printf( "The LED!\n", timeout_ms );
- gpio_close( &gpio );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement