I get that error sometimes from something really simple, i recompile all units and error goes away. Problem is that Lazarus didn't compile some changed unit for whatever reason. In Lazarus you can do that by adding space after any code line so it becomes "modified". 1 thing that can do that (but may not be the issue always) is in Project options -> Miscellaneous -> Always build toggled off.

But there are always some issues with Lazarus, do you have latest daily snapshot or a very old "stable" build?