Old Free Pascal OOP

I found a old OOP Free Pascal program I wrote in 2003. When I tried to compile it the compiler complained “Error: Identifier not found “class”. Nothing in my notes said anything about compiler switches. After a while I found if I added {$mode objfpc} at the beginning of the source it compiled/ran fine.

I also found, I could instead add the fpc, command line switch -MOBJFPC, and that worked also.

fpc -MOBJFPC class01.pp