Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile errors #1

Open
mkopack73 opened this issue Jul 6, 2021 · 0 comments
Open

Compile errors #1

mkopack73 opened this issue Jul 6, 2021 · 0 comments

Comments

@mkopack73
Copy link

Don't know if the libraries got updated since you posted this or what, but when I try to build the source with a fully up to date Pi4, I get the following:

i2c_bus.cpp: In member function \u2018void i2c_bus::write_byte_and_read(uint8_t, uint8_t, uint8_t*, size_t)\u2019:
i2c_bus.cpp:84:38: error: invalid use of incomplete type \u2018struct i2c_msg\u2019
{ address, 0, 1, (typeof(i2c_msg().buf)) &command },
^
i2c_bus.cpp:11:30: note: in definition of macro \u2018typeof\u2019
#define typeof(x) typeof(x)
^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of \u2018struct i2c_msg\u2019
struct i2c_msg msgs; / pointers to i2c_msgs */
^~~~~~~
i2c_bus.cpp:85:16: error: \u2018I2C_M_RD\u2019 was not declared in this scope
{ address, I2C_M_RD, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data },
^~~~~~~~
i2c_bus.cpp:85:16: note: suggested alternative: \u2018I2C_RDWR\u2019
{ address, I2C_M_RD, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data },
^~~~~~~~
I2C_RDWR
i2c_bus.cpp:85:42: error: invalid use of incomplete type \u2018struct i2c_msg\u2019
{ address, I2C_M_RD, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data },
^
i2c_bus.cpp:11:30: note: in definition of macro \u2018typeof\u2019
#define typeof(x) typeof(x)
^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of \u2018struct i2c_msg\u2019
struct i2c_msg msgs; / pointers to i2c_msgs */
^~~~~~~
i2c_bus.cpp:85:72: error: invalid use of incomplete type \u2018struct i2c_msg\u2019
{ address, I2C_M_RD, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data },
^

i2c_bus.cpp:11:30: note: in definition of macro \u2018typeof\u2019
#define typeof(x) typeof(x)
^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of \u2018struct i2c_msg\u2019
struct i2c_msg msgs; / pointers to i2c_msgs /
^~~~~~~
i2c_bus.cpp:83:11: error: elements of array \u2018i2c_msg messages [2]\u2019 have incomplete type
i2c_msg messages[2] = {
^~~~~~~~
i2c_bus.cpp:83:11: error: storage size of \u2018messages\u2019 isn\u2019t known
i2c_bus.cpp:89:16: error: \u2018ioctl\u2019 was not declared in this scope
int result = ioctl(fd, I2C_RDWR, &ioctl_data);
^~~~~
i2c_bus.cpp: In member function \u2018void i2c_bus::write(uint8_t, const uint8_t
, size_t)\u2019:
i2c_bus.cpp:100:35: error: invalid use of incomplete type \u2018struct i2c_msg\u2019
{ address, 0, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data }
^
i2c_bus.cpp:11:30: note: in definition of macro \u2018typeof\u2019
#define typeof(x) typeof(x)
^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of \u2018struct i2c_msg\u2019
struct i2c_msg msgs; / pointers to i2c_msgs */
^~~~~~~
i2c_bus.cpp:100:65: error: invalid use of incomplete type \u2018struct i2c_msg\u2019
{ address, 0, (typeof(i2c_msg().len)) size, (typeof(i2c_msg().buf)) data }
^
i2c_bus.cpp:11:30: note: in definition of macro \u2018typeof\u2019
#define typeof(x) typeof(x)
^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of \u2018struct i2c_msg\u2019
struct i2c_msg msgs; / pointers to i2c_msgs /
^~~~~~~
i2c_bus.cpp:99:11: error: elements of array \u2018i2c_msg messages [1]\u2019 have incomplete type
i2c_msg messages[1] = {
^~~~~~~~
i2c_bus.cpp:99:11: error: storage size of \u2018messages\u2019 isn\u2019t known
i2c_bus.cpp:104:16: error: \u2018ioctl\u2019 was not declared in this scope
int result = ioctl(fd, I2C_RDWR, &ioctl_data);
^~~~~
i2c_bus.cpp: In member function \u2018int i2c_bus::try_write_byte_and_read(uint8_t, uint8_t, uint8_t
, size_t)\u2019:
i2c_bus.cpp:116:38: error: invalid use of incomplete type \u2018struct i2c_msg\u2019
{ address, 0, 1, (typeof(i2c_msg().buf))&byte },
^
i2c_bus.cpp:11:30: note: in definition of macro \u2018typeof\u2019
#define typeof(x) typeof(x)
^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of \u2018struct i2c_msg\u2019
struct i2c_msg msgs; / pointers to i2c_msgs */
^~~~~~~
i2c_bus.cpp:117:16: error: \u2018I2C_M_RD\u2019 was not declared in this scope
{ address, I2C_M_RD, (typeof(i2c_msg().len))size, (typeof(i2c_msg().buf))data },
^~~~~~~~
i2c_bus.cpp:117:16: note: suggested alternative: \u2018I2C_RDWR\u2019
{ address, I2C_M_RD, (typeof(i2c_msg().len))size, (typeof(i2c_msg().buf))data },
^~~~~~~~
I2C_RDWR
i2c_bus.cpp:117:42: error: invalid use of incomplete type \u2018struct i2c_msg\u2019
{ address, I2C_M_RD, (typeof(i2c_msg().len))size, (typeof(i2c_msg().buf))data },
^
i2c_bus.cpp:11:30: note: in definition of macro \u2018typeof\u2019
#define typeof(x) typeof(x)
^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of \u2018struct i2c_msg\u2019
struct i2c_msg msgs; / pointers to i2c_msgs */
^~~~~~~
i2c_bus.cpp:117:71: error: invalid use of incomplete type \u2018struct i2c_msg\u2019
{ address, I2C_M_RD, (typeof(i2c_msg().len))size, (typeof(i2c_msg().buf))data },
^

i2c_bus.cpp:11:30: note: in definition of macro \u2018typeof\u2019
#define typeof(x) typeof(x)
^
In file included from i2c_bus.cpp:8:
/usr/include/linux/i2c-dev.h:66:9: note: forward declaration of \u2018struct i2c_msg\u2019
struct i2c_msg msgs; / pointers to i2c_msgs */
^~~~~~~
i2c_bus.cpp:115:11: error: elements of array \u2018i2c_msg messages [2]\u2019 have incomplete type
i2c_msg messages[2] = {
^~~~~~~~
i2c_bus.cpp:115:11: error: storage size of \u2018messages\u2019 isn\u2019t known
i2c_bus.cpp:121:16: error: \u2018ioctl\u2019 was not declared in this scope
int result = ioctl(fd, I2C_RDWR, &ioctl_data);
^~~~~
make: *** [: i2c_bus.o] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant