I'm new to mbed and i'm trying to create my first class on this platform.
But the problem is, i don't understand how to do it. I tried something which don't work...
That's it :
Coordonnees.hpp
#ifndef __COORDONNEES_
#define __COORDONNEES_
#include "stdint.h"
class Coordonnees
{
private :
int _x;
int _y;
int16_t _angle;
const int16_t _maxX;
const int16_t _maxY;
const int16_t _minAngle;
const int16_t _maxAngle;
bool _depassementX;
bool _depassementY;
public :
Coordonnees(int x, int y);
};
#endif
<<quote>>Error: "Coordonnees::Coordonnees(int, int)" provides no initializer for in "Coordonnees.cpp", Line: 3, Col: 40<</quote>>
What am i doing wrong?
Hi everyone!
I'm new to mbed and i'm trying to create my first class on this platform.
But the problem is, i don't understand how to do it. I tried something which don't work...
That's it :
<<code title=Coordonnees.hpp>>
#ifndef __COORDONNEES_
#define __COORDONNEES_
#include "stdint.h"
class Coordonnees
{
private :
int _x;
int _y;
int16_t _angle;
const int16_t _maxX;
const int16_t _maxY;
const int16_t _minAngle;
const int16_t _maxAngle;
bool _depassementX;
bool _depassementY;
public :
Coordonnees(int x, int y);
};
#endif
<</code>>
<<code title=Coordonnees.cpp>>
#include "Coordonnees.hpp"
Coordonnees::Coordonnees(int x, int y){
_x = x;
_y = y;
_angle = 0;
_maxX = 300;
_maxY = 800;
_minAngle = 0;
_maxAngle = 360;
_depassementX = false;
_depassementY = false;
}
<</code>>
I think that i made everything like the Flasher example available on mbed...
[[https://os.mbed.com/cookbook/Writing-a-Library]]
But when i try to build it, i have this error :
<<quote>>Error: "Coordonnees::Coordonnees(int, int)" provides no initializer for in "Coordonnees.cpp", Line: 3, Col: 40<</quote>>
What am i doing wrong?
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.
Hi everyone!
I'm new to mbed and i'm trying to create my first class on this platform. But the problem is, i don't understand how to do it. I tried something which don't work...
That's it :
Coordonnees.hpp
Coordonnees.cpp
I think that i made everything like the Flasher example available on mbed... https://os.mbed.com/cookbook/Writing-a-Library But when i try to build it, i have this error :
<<quote>>Error: "Coordonnees::Coordonnees(int, int)" provides no initializer for in "Coordonnees.cpp", Line: 3, Col: 40<</quote>>
What am i doing wrong?