I get “F1026 File not found”, OR some compiler options are not passed to the compiler from the IDE.

Abstract: When building a project from the IDE or from the command line using MSBuild the compiler complains about not being able to find some DCU’s. OR The IDE does not pass my compiler options to the compiler.

Building a project causes the compiler to give “F1026 File not found” errors for my DCU’s even though they physically exist at the correct location! Another manifestation of this issue is as follows, I set a compiler option in the IDE, but when I compile the application I get a compiler error indicating that compiler option I JUST set is not being passed to the compiler. This could be due to an environment variable that is not set correctly thus causing the build process to ignore the unit search path you have specified.

To check that this is the case, do the following:

In the IDE from the main menu, navigate to

“Tools|Options|Environment Options|Compiling and Running” 

  1. switch “Show Commandline” ON
  2. AND set sure you have “Verbosity” set to “Diagnostic”.

Then build your project, the IDE will now give you lots of information in the Messages|Ouput window, the crucial bit of information you must look for is the “PLATFORM” environment variable, if it is anything OTHER than “AnyCPU”, for instance,

PLATFORM                       = BNB

Then is this probably the cause of you problem, if the environment variable, “PLATFORM” is not set to “AnyCPU” then do the following:

In the IDE:

1) navigate to Tools|Options|Environment Options|Environment Variables| User overrides Press [New...]

2) Variable Name : "PLATFORM"  this is without quotes

3) Variable Value :"AnyCPU" again without quotes. In XE2 and later make the value blank/empty.

4) Click [OK]

5) [OK] again

Your application should now build as you would expect and pick up the all your DCUs.

Author: Roy Nelson