unknown type Off_t

231 views
Skip to first unread message

Sam James

unread,
Mar 23, 2021, 1:15:43 PM3/23/21
to bcm2835
Hi All

I've been building a large project over the last year using bcm2835.h to run sensors and the like on both a pi 4 and a pi zero. 

Due to a clean install on my pi 4 development machine I upgraded from  1.6 to 1.67 and I started getting:

/usr/local/include/bcm2835.h:692:8: error: unknown type name ‘off_t’
 extern off_t bcm2835_peripherals_base;

checking the bcm2835.h header I only see one include:

#include<stdlib.h>

which doesn't seem to define off_t. I have added #include<sys/types.h> before #include <bcm2835.h> and everything is looking like it's working fine.

is this a bug or am I missing something???

I see there are a couple of mentions of changed made in 1.61 and 1.62 about the off_t.

Thanks

Sam

Mike McCauley

unread,
Mar 23, 2021, 8:52:12 PM3/23/21
to bcm2835, Sam James
Thanks for the report Sam,

Is anyone else seeing this issue on RPI 4?

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



Sam James

unread,
Mar 28, 2021, 11:52:56 AM3/28/21
to Mike McCauley, bcm2835
Hi

Bit more info if it helps, I only get the error message compiling with
certain compilers:

gcc-8 works
arm-linux-gnueabihf-gcc-8 works
c99-gcc error -
/usr/local/include/bcm2835.h:692:8: error: unknown type name ‘off_t’ -
extern off_t bcm2835_peripherals_base;
c89-gcc errpr =
/usr/local/include/bcm2835.h:692:8: error: unknown type name ‘off_t’ -
extern off_t bcm2835_peripherals_base;


this time it's a completely clean "hello world" program with an #include
<bcm2835.h>

adding #include<sys/types.h> still sorts the problem on c99-gcc which
was what I was trying to use

Sam

Mike McCauley

unread,
Mar 29, 2021, 7:45:05 PM3/29/21
to bcm2835, Sam James
Thanks Sam,

new version 1.69 uploaded should fix this problem.

Cheers.
Reply all
Reply to author
Forward
0 new messages