Recent

Author Topic: "Build" compiles unwanted source code  (Read 5071 times)

davelane

  • Newbie
  • Posts: 3
"Build" compiles unwanted source code
« on: July 11, 2010, 07:26:14 pm »
I'm totally new to Lazarus (win32) and I am experimenting in trying to port a Borland Delphi app.

I started with a blank application and tried adding a bunch of non-graphic units to the project. They are all located in a sub-folder of the project directory. I have been able to build all these units individually without problems, but when I build the full project it tries to compile a bunch of .pas files that are in the same directory but are not included in the application (units not referenced in the project). If I remove the first file that it tries to compile, it just goes down to the next one.

Any idea why it does this or how to stop this behavior?

--- Dave

cpalx

  • Hero Member
  • *****
  • Posts: 754
Re: "Build" compiles unwanted source code
« Reply #1 on: July 11, 2010, 07:57:45 pm »
did you add your .pas files to your project?. Open your project then open all files and press Shift+F11 (Windows and linux) in mac press MAC + OPT + A. You must do it file by file

davelane

  • Newbie
  • Posts: 3
Re: "Build" compiles unwanted source code
« Reply #2 on: July 11, 2010, 08:04:07 pm »
All of the units that I want to include were added using the Shift-F11. These units include some additional .pas files via explicit {$I file.pas} lines in the unit source.

But the the problem is that the build includes other .pas files not part of the project.

--- Dave

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12857
  • FPC developer.
Re: "Build" compiles unwanted source code
« Reply #3 on: July 12, 2010, 08:41:14 am »

But the the problem is that the build includes other .pas files not part of the project.

Keep in mind that Pascal compilers with unit systems recursively search their own files. Apparantly these files are referenced in your sources somewhere.

davelane

  • Newbie
  • Posts: 3
Re: "Build" compiles unwanted source code
« Reply #4 on: July 13, 2010, 12:36:49 am »
Unfortunately this is not the case here. The one it catches first is actually the main program of a utility program.

--- Dave

 

TinyPortal © 2005-2018