views:

744

answers:

4

I've been trying to compile a Borland C++ Builder 6 project, but linker dies with exact following error:

[Linker Fatal Error] Fatal: Unable to open file '.OBJ'

Strange thing about it is that it doesn't give any file name except the extension. It looks like an internal bug, though googling for it didn't give any results. Has anyone encountered this error?

== SOLVED ==

It was actually an invalid compiler directive in one of the sourcefiles which caused linker command line to be corrupted. Thanks for help.

+1  A: 

I've never used Borland C++ Builder, but that might sound like a broken project or a corrupted object file - I guess you have not had any compilation error. A few steps you may want to take:
- rebuild the project
- check the exact command-line used to invoke the linker, and look for strange things in the custom project settings (in such a thing exists).

If you indeed find some strange things in the command-line, hand-editing the project file (kids, don't do this at home) to remove the offending part may be the last resort before building up a new project.

RaphaelSP
Well actually this was a freshly created project - I'm splitting an old project into parts. Well I haven't noticed anything strange in there.
frgtn
+3  A: 
JRL
+1  A: 

Ive seen this before with visual studio, normally if i stop the compiler building while its in the linking process, not sure if borland generates obj files during its linking process? have a search in your project directory, and delete the obj files possibly in a folder called "intermediate" and try again

Stowelly
+1  A: 

I suspect whitespace or other characters such as - or + on your command line.

David Dean - Embarcadero