【发布时间】:2017-08-13 20:53:32
【问题描述】:
我为我的树莓派设置了一个交叉编译器,我在这里找到的那个:Installing Raspberry Pi Cross-Compiler
现在一切正常,直到我想使用 I2c 库 (i2c-dev.h)。
使用 arm-linux-gnueabihf-g++ 编译器编译以下代码时,出现错误:
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;
^
同时,当我在 raspi 上编译代码时,它只是运行。
#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;
关于可能原因的任何想法,或关于如何使交叉编译器正常工作的解决方案?
【问题讨论】:
标签: c++ cross-compiling