nagimov / adxl345spi

ADXL345 three-axis accelerometer reader (SPI interface)
GNU General Public License v3.0
62 stars 23 forks source link

Not installing on latest Raspian image #10

Closed iaindinw closed 2 years ago

iaindinw commented 2 years ago

Hello, I have used your very useful tool previously on various Buster builds and never had any issues. However on a fresh Bullseye release on rp4 I'm not able to install, see attached error.

pi@raspberrypi:~/adxl345spi $ sudo make if ! dpkg-query -W -f='${Status}' pigpio | grep "ok installed"; then apt-get -y install pigpio; fi install ok installed gcc -Wall -pthread -lpigpio -lrt adxl345spi.c -o adxl345spi adxl345spi.c: In function ‘printUsage’: adxl345spi.c:28:34: warning: ‘%s’ directive argument is not a nul-terminated string [-Wformat-overflow=] 28 | printf( "adxl345spi (version %s) \n" | ^~ ...... 54 | "", codeVersion, timeDefault, freqMax, freqDefault); | ~~~~~~~~~~~ adxl345spi.c:16:12: note: referenced argument declared here 16 | const char codeVersion[3] = "0.3"; // code version number | ^~~~~~~~~~~ /usr/bin/ld: /tmp/ccwOsOAb.o: in functionreadBytes': adxl345spi.c:(.text+0xa8): undefined reference to spiXfer' /usr/bin/ld: /tmp/ccwOsOAb.o: in functionwriteBytes': adxl345spi.c:(.text+0x108): undefined reference to spiWrite' /usr/bin/ld: /tmp/ccwOsOAb.o: in functionmain': adxl345spi.c:(.text+0x42c): undefined reference to gpioInitialise' /usr/bin/ld: adxl345spi.c:(.text+0x45c): undefined reference tospiOpen' /usr/bin/ld: adxl345spi.c:(.text+0x570): undefined reference to time_sleep' /usr/bin/ld: adxl345spi.c:(.text+0x590): undefined reference totime_time' /usr/bin/ld: adxl345spi.c:(.text+0x624): undefined reference to time_time' /usr/bin/ld: adxl345spi.c:(.text+0x69c): undefined reference totime_sleep' /usr/bin/ld: adxl345spi.c:(.text+0x6bc): undefined reference to gpioTerminate' /usr/bin/ld: adxl345spi.c:(.text+0x6c0): undefined reference totime_time' /usr/bin/ld: adxl345spi.c:(.text+0x7f8): undefined reference to time_time' /usr/bin/ld: adxl345spi.c:(.text+0x8b0): undefined reference totime_time' /usr/bin/ld: adxl345spi.c:(.text+0x994): undefined reference to gpioTerminate' /usr/bin/ld: adxl345spi.c:(.text+0xa28): undefined reference togpioTerminate' collect2: error: ld returned 1 exit status make: *** [Makefile:17: adxl345spi] Error 1 `

Appreciate supporting of non standard installations is outwith skills but any support to get it working again on the default pi configuration would be great. Happy to assist in testing if this is feasible.

nagimov commented 2 years ago

Are you using 2021-10-30-raspios-bullseye-armhf-full ? I'll look into this in 2 weeks (no access to a Pi currently), hopefully this is just a pigpio dependency issue

iaindinw commented 2 years ago

Yes it was a fresh install of that OS. Thanks again for your code.

folkhack commented 2 years ago

Ran into this same issue - turns out it's a slight issue with how the Makefile orders the gcc command, specifically with the libraries. Fixed in PR #11

Thanks or a great lib and let me know if you have questions!

nagimov commented 2 years ago

Resolved by #11