Compilation error cpp | Sololearn: Learn to code for FREE!


Compilation error cpp

Hello guys? Can anyone help me with this cpp error? When I write Board[1][0]= new Soldier(true,0,1,*this); I get an error saying that Soldier does not name a type even though I have included it

7/30/2019 5:44:00 PM


6 Answers

New Answer


don't create 2 separate code. U have to declare all in 1 code sadly, SoloLearn don't allow to access from 2 separate code. So just put it all in 1 code. 😅


#include "piece.h" #include "rook.h" #include "knight.h" #include "bishop.h" #include "queen.h" #include "king.h" #include "soldier.h" MargK645 These aren't any standard library hence they aren't available here in sololearn.


This should help you deal with this type of error:


Aakaansha💕 i have included the first code in the second :


Aakaansha💕 thank you I have included "soldier.h" but I still get the same error. I don't know why is this happening :(


Ace thank you very much! The problem is that I have done this procedure for the other figures and it was ok but now my Soldier figure has this compilation problem. I have checked if I haven't included something correctly but I find everything to be ok