This errors occurs when previously compile is not properly or not completed. It can be resolved by executing following queries directly in Sql Server Microsoft Dynamics AX database.
select * from SYSLASTVALUE where ELEMENTNAME = 'CIL Generation'
This will give you the record for CIL generation , after confirming that record exists delete all the records.
delete from SYSLASTVALUE where ELEMENTNAME = 'CIL Generation'