Compiler error: definition of implicitly-declared Class

Post Reply
FredCailloux
Posts: 69
Joined: Sat Mar 28, 2015 4:45 am
Location: Quebec - Canada

Compiler error: definition of implicitly-declared Class

Post by FredCailloux » Sat Feb 13, 2016 3:30 am

I have this LS7366.h file and LS7366.cpp that I am building, in which I define the Class LS7366, with the following line:

Code: Select all

// in the header LS7366.h
	#if !defined		DSPI_PORT						
	#define			DSPI_PORT	DSPI0	// Default DSPI port = DSPI0		
	#endif								
	#define NON_QUADRATURE	0x00
// and a whole buch of other #define lines ...
	
class	LS7366 {
private:	DSPI_PORT DSPIjack	;
and some more code lines   ;  }

// in the code file LS7366.cpp  -  Class definition
LS7366::LS7366 ( ) { }
void LS7366::begin () 	{	
and some more code lines 	; }
and some more functions defined ...
void LS7366 :: end ( ) 	{
and some more code lines ; }	
I took this template from another working Class so I am pretty sure the layout is OK and yet I am getting a compiler error and I cant figure out what the problem may be. What is the compiler means by "implicitely-declared" ? Where is my mistake ? What needs to be done to correct this compiler error ?
LS7366.cpp:7:20: error: definition of implicitly-declared 'LS7366::LS7366()
Thanks
Prashant Tripathi :idea: Knowing is to the Self what knowledge is to the ego

FredCailloux
Posts: 69
Joined: Sat Mar 28, 2015 4:45 am
Location: Quebec - Canada

Re: Compiler error: definition of implicitly-declared Class

Post by FredCailloux » Sat Feb 13, 2016 3:44 am

I found the problem.
Forgot to include the line:

Code: Select all

class	LS7366	{
private:	DSPI_PORT	DSPIjack	;
public:	
LS7366 ( ) ; // Forgot this line in my definition
void	begin ( ) ;
void	end (  ) ; 
I got rit of the error.
And now I have another type of compiler error to solve. But that will be part of another investigation and probably another posted question.
Cheers everyone :!:
Prashant Tripathi :idea: Knowing is to the Self what knowledge is to the ego

Post Reply