bcm2835.h not defined

92 views
Skip to first unread message

Greg Lecureux

unread,
Apr 20, 2022, 10:28:17 PM4/20/22
to bcm2835
Hey there, im working on the Pedal-Pi Project From Electrosmash.com in which i use PWMs to alter input signals. 

in order to do that i need the bcm2835 libraries to control the gpio pins
but everytime i go to complie the code (even example codes like blink) 
say that "undefined reference to bcm2835x) and i cant seem to figure out why?
I configure just like the instructions say to. but nothing?

Thanks for any help!

Mike McCauley

unread,
Apr 20, 2022, 10:59:52 PM4/20/22
to bcm2835, Greg Lecureux
Hi,

will you please post an exact copy of your command line, error message and
everything leading up to it.

Cheers.
--
Mike McCauley VK4AMM mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com 5R3MRFM2+X6
Phone +61 7 5598-7474



Greg Lecureux

unread,
Apr 21, 2022, 10:35:33 AM4/21/22
to bcm2835
Hey thanks for the quick response! As soon as I get back home I’ll go ahead and post the command line script and errors

Greg Lecureux

unread,
Apr 21, 2022, 3:17:51 PM4/21/22
to bcm2835
wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
--2022-04-21 02:16:43--
http://www.airspayce.com/mikem/bcm2835/bcm2835-1.71.tar.gz
Resolving www.airspayce.com (www.airspayce.com)... 192.185.48.187
Connecting to www.airspayce.com
(www.airspayce.com)|192.185.48.187|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 276152 (270K) [application/x-gzip]
Saving to: ‘bcm2835-1.71.tar.gz’

bcm2835-1.71.tar.gz 100%[=====================>] 269.68K   737KB/s   in 0.4s

2022-04-21 02:16:43 (737 KB/s) - ‘bcm2835-1.71.tar.gz’ saved [276152/276152]

pi@raspberrypi:~ $ tar xvfz bcm2835-1.71.tar.gz
bcm2835-1.71/
bcm2835-1.71/configure.ac
bcm2835-1.71/COPYING
bcm2835-1.71/examples/
bcm2835-1.71/examples/spi/
bcm2835-1.71/examples/spi/spi.c
bcm2835-1.71/examples/input/
bcm2835-1.71/examples/input/input.c
bcm2835-1.71/examples/spiram/
bcm2835-1.71/examples/spiram/spiram.h
bcm2835-1.71/examples/spiram/spiram_test.c
bcm2835-1.71/examples/spiram/spiram.c
bcm2835-1.71/examples/event/
bcm2835-1.71/examples/event/event.c
bcm2835-1.71/examples/pwm/
bcm2835-1.71/examples/pwm/pwm.c
bcm2835-1.71/examples/gpio/
bcm2835-1.71/examples/gpio/gpio.c
bcm2835-1.71/examples/blink/
bcm2835-1.71/examples/blink/blink.c
bcm2835-1.71/examples/spin/
bcm2835-1.71/examples/spin/spin.c
bcm2835-1.71/examples/i2c/
bcm2835-1.71/examples/i2c/i2c.c
bcm2835-1.71/config.guess
bcm2835-1.71/NEWS
bcm2835-1.71/depcomp
bcm2835-1.71/configure
bcm2835-1.71/aclocal.m4
bcm2835-1.71/compile
bcm2835-1.71/INSTALL
bcm2835-1.71/Makefile.in
bcm2835-1.71/missing
bcm2835-1.71/config.sub
bcm2835-1.71/Makefile.am
bcm2835-1.71/ChangeLog
bcm2835-1.71/README
bcm2835-1.71/install-sh
bcm2835-1.71/config.h.in
bcm2835-1.71/src/
bcm2835-1.71/src/test.c
bcm2835-1.71/src/bcm2835.h
bcm2835-1.71/src/bcm2835.c
bcm2835-1.71/src/Makefile.in
bcm2835-1.71/src/Makefile.am
bcm2835-1.71/ltmain.sh
bcm2835-1.71/AUTHORS
bcm2835-1.71/doc/
bcm2835-1.71/doc/Doxyfile.in
bcm2835-1.71/doc/Makefile.in
bcm2835-1.71/doc/Makefile.am
bcm2835-1.71/test-driver
pi@raspberrypi:~ $ cdbcm2835-1.71
bash: cdbcm2835-1.71: command not found
pi@raspberrypi:~ $ cd bcm2835-1.71
pi@raspberrypi:~/bcm2835-1.71 $ /configure
bash: /configure: No such file or directory
pi@raspberrypi:~/bcm2835-1.71 $ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for clock_gettime in -lrt... yes
checking for doxygen... no
configure: WARNING: Doxygen not found - continuing without Doxygen support
checking for ranlib... ranlib
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating config.h
config.status: executing depfiles commands
pi@raspberrypi:~/bcm2835-1.71 $ make
make  all-recursive
make[1]: Entering directory '/home/pi/bcm2835-1.71'
Making all in src
make[2]: Entering directory '/home/pi/bcm2835-1.71/src'
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -MT bcm2835.o -MD -MP -MF
.deps/bcm2835.Tpo -c -o bcm2835.o bcm2835.c
mv -f .deps/bcm2835.Tpo .deps/bcm2835.Po
rm -f libbcm2835.a
ar cru libbcm2835.a bcm2835.o
ranlib libbcm2835.a
make[2]: Leaving directory '/home/pi/bcm2835-1.71/src'
Making all in doc
make[2]: Entering directory '/home/pi/bcm2835-1.71/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/pi/bcm2835-1.71/doc'
make[2]: Entering directory '/home/pi/bcm2835-1.71'
make[2]: Leaving directory '/home/pi/bcm2835-1.71'
make[1]: Leaving directory '/home/pi/bcm2835-1.71'
pi@raspberrypi:~/bcm2835-1.71 $ sudo make install
Making install in src
make[1]: Entering directory '/home/pi/bcm2835-1.71/src'
make[2]: Entering directory '/home/pi/bcm2835-1.71/src'
 /bin/mkdir -p '/usr/local/lib'
 /usr/bin/install -c -m 644  libbcm2835.a '/usr/local/lib'
 ( cd '/usr/local/lib' && ranlib libbcm2835.a )
 /bin/mkdir -p '/usr/local/include'
 /usr/bin/install -c -m 644 bcm2835.h '/usr/local/include'
make[2]: Leaving directory '/home/pi/bcm2835-1.71/src'
make[1]: Leaving directory '/home/pi/bcm2835-1.71/src'
Making install in doc
make[1]: Entering directory '/home/pi/bcm2835-1.71/doc'
make[2]: Entering directory '/home/pi/bcm2835-1.71/doc'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/pi/bcm2835-1.71/doc'
make[1]: Leaving directory '/home/pi/bcm2835-1.71/doc'
make[1]: Entering directory '/home/pi/bcm2835-1.71'
make[2]: Entering directory '/home/pi/bcm2835-1.71'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/pi/bcm2835-1.71'
make[1]: Leaving directory '/home/pi/bcm2835-1.71'
pi@raspberrypi:~/bcm2835-1.71 $

Mike McCauley

unread,
Apr 21, 2022, 4:42:08 PM4/21/22
to bcm...@googlegroups.com
Thanks.

I dont see any errors there.

Your library has now been built, but not installed in a place where other
projects can find it.

Perhaps you should now do the 'make install' as root, to install the library
and header, per the instructions in the documentation:

http://www.airspayce.com/mikem/bcm2835/index.html

Cheers.
Reply all
Reply to author
Forward
0 new messages