Home  ==>  papers  ==>  IDE  ==>  delphi_ide_pathes   

DELPHI IDE Pathes - Felix John COLIBRI.

1 - The many Delphi IDE pathes

This paper explains what pathes are used by the Delphi IDE

Delphi uses several pathes:

  • the Windows environment variables
  • the Registry pathes
  • the RSVARS.BAT definitions
  • the Tools | Options pathes
  • the Project | Options pathes
  • the .dpr pathes

2 - The Windows Environment Variable PATH

When we install Delphi, the PATH environment variable is modified.

We use a simple utility to display the environment variables:


We split the Path variable in the individual pathes:



  • we hilighted the Xe7 pathes
  • there are also Xe8 pathes, Xe3 pathes and Delphi 6 pathes
  • there are Android pathes we used for direct android compilations

3 - The Rsvars.Bat variables

The Delphi IDE uses pathes shortcuts, like $(BDS). Those definitions are stored in rsvars.bat file stored in Delphi's Bin\  folder
    C:\Program Files\Embarcadero\RAD Studio\10.0\bin\  


Here is the content of our Delphi Xe7 rsvars.bat file:

@SET BDS=C:\Program Files\Embarcadero\Studio\15.0
@SET BDSINCLUDE=C:\Program Files\Embarcadero\Studio\15.0\include
@SET BDSCOMMONDIR=C:\Documents and Settings\All Users\Documents\Embarcadero\Studio\15.0
@SET FrameworkDir=c:\WINDOWS\Microsoft.NET\Framework\v3.5
@SET FrameworkVersion=v3.5
@SET FrameworkSDKDir=
@SET PATH=%FrameworkDir%;%FrameworkSDKDir%;C:\Program Files\Embarcadero\Studio\15.0\bin;C:\Program Files\Embarcadero\Studio\15.0\bin64;C:\Documents and Settings\All Users\Documents\Embarcadero\InterBase\redist\InterBaseXE3\IDE_spoof;%PATH%
@SET PlatformSDK=
@SET CG_BOOST_ROOT=C:\Program Files\Embarcadero\Studio\15.0\include\boost_1_39
@SET CG_64_BOOST_ROOT=C:\Program Files\Embarcadero\Studio\15.0\include\boost_1_50

and if we display each path of PATH in its own directory, we have

C:\Program Files\Embarcadero\Studio\15.0\bin
C:\Program Files\Embarcadero\Studio\15.0\bin64
C:\Documents and Settings\All Users\Documents\Embarcadero\InterBase\redist\InterBaseXE3\IDE_spoof

and replacing each parameter by its value

C:\Program Files\Embarcadero\Studio\15.0\bin
C:\Program Files\Embarcadero\Studio\15.0\bin64
C:\Documents and Settings\All Users\Documents\Embarcadero\InterBase\redist\InterBaseXE3\IDE_spoof

Note that

  • in our Delphi Xe7 version we have no %rameworkSDKDir% (we had not the Mobile Studio installed)
  • the last %PATH% is a placeholder for the Windows PATH value (the "SET PATH" being the cmd.exe command which dynamically modifies the value of the Windows PATH environment variable, concatenating at the end the current in-memory PATH value)

4 - The Windows Registry

The Windows Registry contains the default values that are imported in the IDE.

Here is a partial view of the Delphi Xe7 registry:


For our DCC build tools, we created a unit which analyzes our Delphi registry pathes (we only analyzed Delphi 5, Delphi 6, Delphi Xe2, Delphi Xe7 and Berlin).

Here is the display of the Xe7 registry :


Please note:

  • some variables are not defined in rsvars.bat: BDSLIB and BDSUSERDIR. Those are defined by the IDE itself
    • BDSLIB is BDS plus "\Lib"
    • BDSUSERDIR is your user dir plus "Embarcadero\Studio\15.0"

5 - Tools | Options | Library

The menu item Tools contains additional information which are used for all projects

5.1 - Tools | Environment Variables

Here is a display of our variables :



  • the top part is computed by the IDE using the Window registry and IDE's own computations. For instance,
    • BDSLIB is defined as c:\program files\embarcadero\studio\15.0\lib
    • BDSUSERDIR is defined as C:\Documents and Settings\Felix\Mes documents\Embarcadero\Studio\15.0
  • we cannot delete any of those variables
  • we can override some of those values by selecting an item and clicking "add override"
  • the bottom part are "user overrides". Here are the overrides of the system variables or new variables. Some of those "user" variables are already defined by the IDE

5.2 - Tools | Options | Delphi Options | Library>

Here are our Library pathes :


5.2.1 - Selecting the Platform

Delphi contains pathes for each platform.

At the top of this dialog, we first select the target for which we want to display the pathes. In our case the ""32-bit Windows" platform is selected


5.2.2 - Library Path :

We can display and modify the library pathes by clicking on the ellipsis "..." icon at the rigth of the "Library Path" combo:


For the selected Win 32 platform, the detailed content of our list is:

C:\Program Files\FastReports\LibD21
C:\Program Files\Raize\CS5\Lib\RS-XE7\Win32
C:\Program Files\madCollection\madBasic\BDS15\win32
C:\Program Files\madCollection\madKernel\BDS15\win32
C:\Program Files\madCollection\madSecurity\BDS15\win32
C:\Program Files\madCollection\madShell\BDS15\win32


  • the items come from the Windows Registry
  • the first row is always $(BDSLIB)\$(Platform)\release
    • As explained $(BDSLIB) is BDS+ "\Lib".
    • $(Platform) will be the platform selected in the project manager for some project. For instance, we selected Win 32
    In our case


    so $(BDSLIB)\$(Platform)\release will be resolved as

      c:\Program Files\Embarcadero\Studio\15.0\LIB\Win32\release


  • $(BDSUSERDIR)\Imports will resolve to

      C:\Documents and Settings\Felix\Mes documents\Embarcadero\Studio\15.0\Imports

    will depend on the current user. In our case

  • $(BDSCOMMONDIR)\Dcp will resolve to

      C:\Documents and Settings\All Users\Documents\Embarcadero\Studio\15.0\Dcp

The purpose of those pathes is to allow the compiler to include .DCUs without having to recompile the .PAS.

So if you installed DevExpress Vcl (223 packages !) or Jedi Jvcl (271 packages, 264 .DCUs) it certainly will speed up your compilation if you let the compiler include the .DCU instead of compiling the .PAS

IMPORTANT, note that

  • since the first two entries ($(BDSLIB)\$(Platform)\release and $(BDSUSERDIR)\Imports) cannot be resolved for all platforms and users, those two items are ALWAYS grayed.
    The items will be resolved at compile time. And they are very important.

    Therefore NEVER click "Delete Invalid Pathes"

    Should this happen, add those items back using the values presented here

5.2.3 - The Browsing Path

Our Browsing Path contains :

$(BDS)\source\Property Editors\Indy10
C:\Program Files\FastReports\LibD21
C:\Program Files\madCollection\madBasic\Sources
C:\Program Files\madCollection\madKernel\Sources
C:\Program Files\madCollection\madSecurity\Sources
C:\Program Files\madCollection\madShell\Sources

So basically it contains the pathes of

  • the Delphi source\
  • some components sources (FDastReport, Madshi, Jedi)
and we can remove or add other pathes

Those pathes are mainly used by the Delphi editor, to be able to load the text of some unit by simply using Ctrl Click on the unit name or some identifier

5.2.4 - Debug DCU Path

Our content is


6 - Project | Options

6.1 - How to include a unit

There are several ways to include a Unit in a Delphi project
  • saving it in the .DPR (.DPK) path
  • adding it to the project .DPR
  • specifying the Search Path in the "Project | Options"
  • specifying the Library Path / Browsing Path

A simple example

Let's start a first VCL project
   "File | New | Vcl Forms Application"
   save the DPR as p_project_1.dpr, u_main.pas in some pathes_demo\project_1\  path
   add some unit "File | New | Delphi Unit" and save it as u_calc.pas in a units\  sub directory
   compile everything

   the .EXE and the .DCU are save in a win32\debug\  subdirectory of the .DPR path:


   since we want to reuse the specify the .Exe and .DCU pathes: "Project | Options | Delphi Compiler | Output Directory"


The default is

In our case for the Win32 platform in debug mode, it would be a the Win32\debug\  subdirectory of the .DPR folder


Change the following values

  • replace the "Output Directory" in "..\_exe"
  • replace the "Unit Output Directory" in "_exe\_dcu"
   the .DCUs are now all in the _exe\dcu\  folder


Now let's create another project, project_2, which will use the u_calc unit:
   "File | New | Vcl Forms Application"
   save the DPR as p_project_2.dpr, u_main.pas in some pathes_demo\project_2\  path
   the main unit will contain Uses u_calc

   the compiler cannot find the u_calc unit:

  [dcc32 Fatal Error] u_main_2.pas(21): F1026 File not found: 'C:programsusidepathes_demoproject_2u_calc.dcu'

6.1.1 - Copying u_calc in the .DPR project

This is a simple solution but would lead to massive code duplication

6.1.2 - Including the u_calc in the .DPR

To include the unit in the .DPR
   "Project | Add to Project" then navigate to the project_1\units\  folder and select u_calc.pas

The .DPR source ("Project | View Source") will now contain a line including the u_calc file, and the project manager also contains a node for this unit :


Please note that

  • the path has nicely been compile as a relative path
  • we could also manually add lines to add other units (possibly using some utility to automate this process), and then could use absolute path.
  • if we move or rename the units or the pathes, we must make sure that those .DPR additions are still valid.

This is very nice but could be tedious should we want to include massive libraries (Jedi, DevExpress etc).

Therefore it is easier to somehow tell the IDE where it can find the relevant units without having to implicitely include them in the .DPR. Hence the "Project Option | Search Pathes" or "Tools | Options | Library"

6.1.3 - The Project | Options | Search Pathes

The next more local parameter is in the "Project Options;
   remove the u_calc inclusion in the project
  • either delete the "u_calc in '..project_1unitsu_calc.pas'" part of the .DPR
  • or "Project Manager | u_calc.pas | Remove From Project" and confirm
   add a search path : "Project | Options | Delphi Compiler | Search Pathes | ellipsis | Browse | navigate and select u_calc | Add"


   click "Ok" and compile

In this case, the include path will be saves in the .DPROJ:

<Project xmlns="">
  <PropertyGroup Condition="'$(Cfg_1_Win32)'!=''">

Note that

  • using the "ellipsis" to include the path will add an absolute path. You can modify this path into a relative path, but you have to compute it manually
  • make sure there is no conflict between the units included in the "Search Pathes" and those directly included in the .DPR (in case of several units with the same name in different pathes or in case of change of unit name / path names)
  • we added a Search Path only for Win 32 in debug mode. This is specified in the top level combobox of the "Project Option | Delphi Compiler" dialog

    We could place the include at some other target / debug level by selecting another level :


    In general, we start including at the highest level ("all configurations") and then override or add when required for the more specific level ("32 bit Windows Platform" for instance)

The drawbacks of the Search path are
  • the units are not displayed in the Project Manager treeview. You still can open a unit by "Ctrl Click" on the unit in some Uses list, or by "Ctrl Click" on some of the Unit's identifiers
  • the search pathes apply to this project only.

6.1.4 - Project | Options | Search Pathes for dcu

To avoid the recompilation of u_calc.pas, we can simply add the u_calc.DCU path in the Search Pathes
   remove the .DPR inclusion of u_calc, and remove any Search Path

   "Project | Options | Delphi Compiler | Search Pathes" and add .._exedcu

The u_calc.pas unit cannot be loaded in the Editor with "Ctrl Click":
   in the main unit, select u_calc and perform "Ctrl Click"
   the Editor cannot find the unit: "unable to locate file u_calc.pas"


   add a button which calls a method of the u_calc unit
   place a breakpoint on the calling statement
   run, click the button, hit F7 when the execution reaches the breakpoint
   the debugger cannot find the source:


6.1.5 - The Tools | Options | Library

We can also specify to include some units using the "Tools | Options | Library"
   remove the .DPR inclusion of u_calc, and remove any Search Path
   add a library path: "Tools | Options | Library Path | ellipsis | navigate and add the dcu path"



The u_calc.pas unit cannot be loaded in the Editor with "Ctrl Click":
   in the main unit, select u_calc and perform "Ctrl Click"
   the Editor cannot find the unit: "unable to locate file u_calc.pas"


   add a button which calls a method of the u_calc unit
   place a breakpoint on the calling statement
   run, click the button, hit F7 when the execution reaches the breakpoint
   the debugger cannot find the source:


So adding the dcu's path to "Tools | Options | Library Path" is the same as adding the dcu's path to "Project | Options | Delphi Compiler | Search Pathes", but the "Tools ..." will work for any project

6.1.6 - Tools | Options | Browsing Path

To be able to load the unit in the Editor and debug the u_calc unit, we must
  • either add the unit's path to "Project | Options | Delphi Compiler | Search Pathes"
  • add the unit's path to "Tools | Options | BROWSING PATH"
   remove the .DPR inclusion of u_calc, and remove any Search Path
   add a browse path: "Tools | Options | Browsing Path | ellipsis | navigate and add the u_calc.pas path"


load u_calc by "Ctrl Clic" on u_calc in the Uses u_calc; clause
set a breakpoint on the call of an u_calc.pas Unit

Please note
  • adding the .pas path to the "Tools | Options | Browsing Path" does not allow the compiler to find the u_calc.pas (F1026 File not found) (whereas the "Project | Options | Delphi Compiler | Search Pathes" did allow both compilation, loading with "Ctrl Click" and debugging). To compile, the "Tools | Options | Library Path" must specify where the u_calc.dcu is located

7 - Custom path parameters

If you have to include several related pathes, you can create your own parameters
  • either in the Windows Environment Variables
  • or in "Tools | Options | Environment Variables"

Here is an example of the second option:
   create a "pathes_demo\project_1\units2\ " path
   place some u_compute.pas unit in this folder
   create a variable for "..project_1" in Delphi : "Tools | Options | Environment Variables | New"
   type "calc" and "..project_1"


We can now use this variable as $(calc) in any path we specify in the IDE.
   create a new project
   add a USES u_compute; to the main Unit
   add the Search Path using the environment variable


load u_compile by "Ctrl Clic" on u_calc in the Uses u_calc; clause
set a breakpoint on the call of an u_compute.pas Unit

Another solution would be to use the SUBST windows command

8 - Delphi Pathes Summary

Delphi Pathes Summary

8.1 - Finding units

  • the Compile can compile a Unit if
    • the .PAS is in the .DPR folder
    • the .PAS is include in the .DPR file
    • the .PAS is in a path included in "Project | Options | Delphi Compiler | Search Pathes"
    • the .DCU is in a path included in "Project | Options | Delphi Compiler | Search Pathes"
    • the .DCU is in a pas included in "Tools | Options | Library Path"
  • the Editor can load a .PAS by using "Ctrl Click" on the unit name listed in a Uses clause or an identifier of the Interface of this Unit, and the debugger will load the unit if
    • the .PAS is in the .DPR folder
    • the .PAS is include in the .DPR file
    • the .PAS is in a path included in "Project | Options | Delphi Compiler | Search Pathes"
    • the .PAS is in a path included in "Tools | Options | Browsing Path"
If you have several units with the same name (a big NO in our own projects) Delphi, in a typical PASCAL way, will always look for the nearest solution.

8.2 - Where to place the DCU's

The default Delphi 6 solution was to keep the DCUs with the .PAS.

For the post Xe versions, we potentially have 7 platfoms, and 2 variants (debug and release). Using the "Project | Options", we could specify 14 dcu pathes !

We always used a separate path to group all DCUs of project families. We often migrate projects for Win 32 and Win 64. Keeping a single DCU path forces the recompilation of all DCUs, including the packages. Therefore we routinely use 2 locations for those projects. However we do not separate debug and release (when the code does not contain different compiling options or $IFDEFs for debug and release).

8.3 - Compiling Packages

When you install packages, if you do not specify where the DCUs should be saved, you will have to look for the DCU's whenever an application uses the components.

To avoid this, the best solution is

  • to add the package's .DCU path(es) in "Tools | Options | Library | Library Path"
  • if you want to be able to load and debug the package's .PAS, add the .PAS path(es) in "Tools | Options | Library | Browsing Path"

8.4 - Default Project Path

Let's us mention another path we often use: when we want to start several projects in some folder, we specify where the "Save Project As" should start. This can be achieved by specifying the "Toools | Options | Environment Options | Default Project"


8.5 - Nevertheless

We recently had some problems with Berlin where we had many compiler errors
  • F1026 File not found
  • F2039 Could not create output file
We checked the presence of the qualifiers before Vcl units, checked the presence of duplicate units, check the PATH length etc. The best solution could be to reinstall Berlin, but we were not allowed do it. Switching from "Compile" to "Build" and direct invocation of DCC somehow solved the problem, albeit in an unsatisfactory way.

9 - Download the Sources

Here are the source code files: The .ZIP file(s) contain:
  • the main program (.DPR, .DOF, .RES), the main form (.PAS, .DFM), and any other auxiliary form
  • any .TXT for parameters, samples, test data
  • all units (.PAS) for units
Those .ZIP
  • are self-contained: you will not need any other product (unless expressly mentioned).
  • for Delphi 6 projects, can be used from any folder (the pathes are RELATIVE)
  • will not modify your PC in any way beyond the path where you placed the .ZIP (no registry changes, no path creation etc).
To use the .ZIP:
  • create or select any folder of your choice
  • unzip the downloaded file
  • using Delphi, compile and execute
To remove the .ZIP simply delete the folder.

The Pascal code uses the Alsacian notation, which prefixes identifier by program area: K_onstant, T_ype, G_lobal, L_ocal, P_arametre, F_unction, C_lass etc. This notation is presented in the Alsacian Notation paper.

As usual:

  • please tell us at if you found some errors, mistakes, bugs, broken links or had some problem downloading the file. Resulting corrections will be helpful for other readers
  • we welcome any comment, criticism, enhancement, other sources or reference suggestion. Just send an e-mail to
  • or more simply, enter your (anonymous or with your e-mail if you want an answer) comments below and clic the "send" button
    Name :
    E-mail :
    Comments * :

  • and if you liked this article, talk about this site to your fellow developpers, add a link to your links page ou mention our articles in your blog or newsgroup posts when relevant. That's the way we operate: the more traffic and Google references we get, the more articles we will write.

Some References

10 - The author

Felix John COLIBRI works at the Pascal Institute. Starting with Pascal in 1979, he then became involved with Object Oriented Programming, Delphi, Sql, Tcp/Ip, Html, UML. Currently, he is mainly active in the area of custom software development (new projects, maintenance, audits, BDE migration, Delphi Xe_n migrations, refactoring), Delphi Consulting and Delph training. His web site features tutorials, technical papers about programming with full downloadable source code, and the description and calendar of forthcoming Delphi, FireBird, Tcp/IP, Web Services, OOP  /  UML, Design Patterns, Unit Testing training sessions.
Created: apr-18. Last updated: dec-2019 - 103 articles, 239 .ZIP sources, 1292 figures
Contact : Felix COLIBRI - Phone: (33) / -
Copyright © Felix J. Colibri 2004 - 2019. All rigths reserved
Back:    Home  Papers  Training  Delphi developments  Links  Download
the Pascal Institute


+ Home
  + articles_with_sources
    + database
    + web_internet_sockets
    + rest_services
    + oop_components
    + uml_design_patterns
    + debug_and_test
    + graphic
    + controls
    + colibri_utilities
    + colibri_helpers
    + delphi
    + IDE
      – delphi_ide_pathes
    + firemonkey
    + compilers
    + vcl
  + delphi_training
  + delphi_developments
  + sweet_home
  – download_zip_sources
  + links
Site Map
– search :

RSS feed