views:

250

answers:

3

When compiling a makefile with the BCB5 commandline tools, the linker gives me this error:

 [exec]  D:\PROGRA~1\Borland\CBUILD~1\Bin\..\BIN\ilink32 @MAKE0000.@@@
 [exec] Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
 [exec] Fatal: Unable to open file 'CONSTS.OBJ'
 [exec] ** error 2 ** deleting lib\paslib.lib

I've checked all the files that get compiled and none of them use or make this file. The make file does not mention it. It is nowhere in the Borland program files. It is not even on my machine as far search can tell me. Predicibly of course, there are no problems when compiling in the IDE. What is this linker doing?

The project is called with make flags -B and -fproject.bpr

A: 

Do you have a consts.dcu in the C:\Program Files\Borland\CBuilder5\Lib\Obj folder?

I don't know exactly what your error is, but perhaps it's related to this file, which is apparently a pre-compiled delphi unit.

Kluge
I DO have this file... what do I do with it?
Everett
A: 

I've not encountered this specific error before - but in case of doubt with weird errors from BCB, my first port of call is always to check the line endings of the files. It really, really wants CRLF line endings. Some stuff will appear to work with LF-only files, until some weird, impossible-seeming error in the middle of the file.

Maybe this isn't your problem, but it's certainly worth looking at.

Another thing you could try is to install Process Monitor from SysInternals. This will give you an idea which file it's looking for and where it's looking for it. It could be it's looking for consts.dcu (Delphi Compiled Unit - almost object code) and looking in the wrong place due to some mis-set path somewhere.

Jon Bright
+1  A: 

I suspect that one of the headers included in the source code has a line like this in it:

#pragma link "consts"

preprocess the .cpp files and you should be able to find where this is coming from.

There are other possibilities, but I think this is the most likely one.

David Dean - Embarcadero