I'm not quite sure how tyo help you here but when I compile Balls.dpr (or Balls.pp) if you have it called that it should also include a Balls.lpi file. In the LPI file are the seetings being used to compile with.

Go into project - Compile Options and click on Show Options: You should have something like:

-S2cdgi -CD -OG1 -gl -XD -vewnhi -l -FuD:\lazarus\JEDI-SDL\ -FuD:\lazarus\S2DL\ -Fu. -FE..\..\compile\ -oD:\lazarus\S2DL\compile\balls.exe

my JEDI-SDL code (all .pas files for JEDI-SDL is D:\lazarus\JEDI-SDL\ (Note the trailing slash)
my S2DL code is in D:\lazarus\S2DL\
I ouput into a seperate compile directory.

See if your options show the same thing and try get it set up in a similar manner.