Using libary in class

Status
Not open for further replies.

Gronfir

New member
Hi
I'm currently building a flight controler and part of the telemetry is a MPU9150 9-axis sensor.
To control it I'm using the driver from I2Cdev in my own mpu class.

Code:
#include "MPU9150/MPU9150.h"
class MPU
{
public:
	void Init();
        <snip>
	
private:
	MPU9150 mpuChip;

	<snip>
};

Code:
#include "MPU.h"
void MPU::Init()
{
	mpuChip.initialize();
        <snip>
}

But that gives me an "undefined reference to MPU9150 MPU9150()" and
"undefined reference to MPU9150 initialize()" error.
If I use the library in the same way outside a class (directly in the setup() function) it works fine.
Am I missing something super obvious here?
 
Last edited:
Status
Not open for further replies.
Back
Top