The following is my c program on geany and how I download bcm2835. Can anyone tell me how to solve the problem?Thank you very much.
Code: Select all
#include<bcm2835.h>
#define LED RPI_GPIO_P1_12
int main(int argc,char **argv){
if(!bcm2835_init())return 1;
bcm2835_gpio_fsel(LED,BCM2835_GPIO_FSEL_OUTP);
unsigned int delay=1000;
while(1)
{
bcm2835_gpio_set(LED);
bcm2835_delay(delay);
bcm2835_gpio_clr(LED);
bcm2835_delay(delay);
}
bcm2835_close();
return 0;
}
Code: Select all
pi@raspberrypi:~ $ wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.39.tar.gz
pi@raspberrypi:~ $ tar zxvf bcm2835-1.39.tar.gz
pi@raspberrypi:~ $ cd bcm2835-1.39
pi@raspberrypi:~/bcm2835-1.39 $ ./configure
pi@raspberrypi:~/bcm2835-1.39 $ make
pi@raspberrypi:~/bcm2835-1.39 $ sudo make check
pi@raspberrypi:~/bcm2835-1.39 $ sudo make install
pi@raspberrypi:~/bcm2835-1.39 $ gcc -o blink -lbcm2835
/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/crt1.o: In function `_start':
/build/glibc-H706YU/glibc-2.19/csu/../ports/sysdeps/arm/start.S:119: undefined reference to `main'
collect2: error: ld returned 1 exit status