Linker Fatal Error unable to locate BPI file.

By: Vincent Drake

Abstract: Explains the cause of and resolution for this error message.

This error message most commonly appears when moving projects from one configuration of C++Builder to another. The quick solution is simply to remove the errant filenames from the Runtime Packages list (click Project, Options, Packages tab, and see the bottom of the dialog) and rebuild the application. For more in-depth explanation read on:

Every C++Builder project provides a list of component packages referenced when linking your application into an executable. This list is usually derived from the component packages installed in the IDE that created the project. When you move a project between configurations of C++Builder, say from Enterprise to Professional or from a version having 3rd party components to one without, the list will instruct the linker to look for packages that don't exist.

That is to say, if the IDE has component package X installed, it will create projects that depend on X. If you try to build this project in a C++Builder environment lacking the X package, "[Linker Fatal Error] Fatal: Unable to open file 'X.BPI'" would be the resulting error message.

Now, just because package X was installed in the IDE doesn't mean the project actually used it. For better or worse, the runtime package list is representative of the IDE's state, not what the project necessarily requires to be linked. You might call the runtime package list an over-zealous cache of libraries. Trimming those BPI files from the package list won't affect your project unless it actually used components in package X, but if that were the case, you would receive errors before the link stage when the pre-compiler attempted to find the component header files.

Server Response from: ETNASC04