I've set up a cross compiler for my raspberry pi, the one I found here: Installing Raspberry Pi Cross-Compiler
Now this has been working fine, up to the point where I want to use an I2c library (i2c-dev.h).
When compiling the code below with the arm-linux-gnueabihf-g++ compiler, I get an error:
In file included from src/I2c.cpp:8:0:
src/../Include/I2c.h:29:18: error: field ‘message’ has incomplete type
struct i2c_msg message;
^
Meanwhile, when I compile the code on a raspi, it simply runs.
#ifndef I2C_H_
#define I2C_H_
#include <linux/i2c-dev.h> // Defines i2c_msg
#include ...
using namespace std;
typedef struct {
struct i2c_msg message;
void (*callback)(int);
int messageID;
} t_msgQueue;
Any ideas on a possible cause, or a solution on how I can make the cross compiler work properly?