Borland编译错误E2194/E2266求助:卸载MSSql Server后命令行编译失败问题排查
Hey there, let's tackle this Borland C++ build issue step by step—since it worked before uninstalling SQL Server, the problem is likely tied to environment variable changes or broken path parsing in your makefile. Here's how to fix it:
1. First, Verify Your Environment Variables
Uninstalling SQL Server might have modified your system environment variables, which could break the $(BCB) reference in your makefile.
- Open a command prompt and run:
echo %BCB% - You should see the full path to your CBuilder5 installation (e.g.,
C:\Program Files\Borland\CBuilder5—no quotes needed here). If it's missing or incorrect:- Go to System Properties → Advanced → Environment Variables
- Add or update the
BCBvariable to point to your CBuilder5 root folder - Restart your command prompt to apply the change
Also, ensure Borland's toolchain is in your PATH. Run bcc32 in the command prompt—if it's not recognized, add the Borland Bin path to your PATH first:
set PATH=T:\Bin;C:\Program Files\Borland\CBuilder5\Bin;%PATH%
2. Fix Path Parsing in the Makefile
Borland's make tool is notoriously picky about paths with spaces and trailing backslashes. Your original makefile has two critical issues:
Issue 1: Trailing backslashes in quoted paths
A trailing backslash before a closing quote (e.g., "C:\Program Files\Borland\CBuilder5\Bin\") tells make to escape the quote, which breaks path parsing. Remove all trailing backslashes from quoted paths.
Issue 2: Unnecessary spaces or malformed separators
Ensure path separators (;) don't have extra spaces around them, and only wrap paths with spaces in quotes (paths without spaces don't need quotes).
Here's the corrected version of your makefile snippet:
SYSDEFINES = _RTLDLL;NO_STRICT;_ATL_APARTMENT_THREADED;USING_ATLVCL;_ATL_NO_SECURITY;INC_ATL_HEADERS;USEPACKAGES INCLUDEPATH = ..\DocGoodsCards;"C:\Program Files\Borland\CBuilder5\Bin";"D:\My project\tmp";..\GroupClients;$(BCB)\Imports;P:\Tr;L:\RSD;"C:\Program Files\Borland\CBuilder5\Projects";..\Common;"C:\Program Files\Common Files\System\MAPI\1049\nt";C:\;$(BCB)\include;$(BCB)\include\vcl;$(BCB)\include\atl;L:\CDBTypeLibrary;L:\EhLib;L:\FastReport;L:\Graphics;L:\ImgEdit;L:\LGTypeLibrary;L:\ML;L:\Rx;L:\TS;L:\TSBF;L:\TSTypeLibrary;L:\VCLZip;"L:\DL" LIBPATH = "C:\Program Files\Borland\CBuilder5\Projects\Lib";L:\Bpl;..\DocGoodsCards;"C:\Program Files\Borland\CBuilder5\Bin";"D:\My project\tmp";"L:\DevExpress\ExpressEditors Library\Lib";L:\DevExpress\ExpressInplaceEditors\Lib;L:\DevExpress\ExpressQuantumGrid\Lib;..\GroupClients;L:\DevExpress\Lib;$(BCB)\Imports;P:\Tr;L:\RSD;"C:\Program Files\Borland\CBuilder5\Projects";..\Common;"C:\Program Files\Common Files\System\MAPI\1049\nt";L:\EhLib;$(BCB)\Lib;$(BCB)\Lib\Obj;L:\Lib;L:\ML;L:\TS;L:\TSBF;"L:\DL"
3. Fix the Error E2266 "No file names given"
This error happens when you remove critical paths that the makefile uses to locate source files. Don't delete paths entirely—instead, fix their formatting as outlined above.
If you still see this after fixing paths:
- Check the makefile's source file list (look for sections like
SOURCE = ...orOBJECTS = ...) to ensure all.cppfiles are referenced correctly with valid relative or absolute paths. - Run
make cleanfirst to delete old temporary files (like.objin yourtmpfolder) before rebuilding.
4. Test the Build Again
Once you've applied the fixes:
- Navigate to your project folder:
cd C:\repos\gradlecpp\Project\src\AssDelay - Regenerate the makefile (optional, but ensures consistency):
Note: If you regenerate, you'll need to reapply the path fixes to the new makefile, or adjust yourT:\Bin\bpr2mak.exe TSAssDelay.bpr.bprproject file to use correctly formatted paths. - Run the build:
T:\Bin\make.exe -fTSAssDelay.mak
This should resolve the E2194 path errors and get your DLL building again.
内容的提问来源于stack exchange,提问作者Olga Pshenichnikova

