Question

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.

Was it helpful?

Solution

Check for illegal whitespace characters in your Linker command line.

If you don't find any, post your linker command line here (Off the top of my head found in Project -> Options -> Linker -> Command Line).

OTHER TIPS

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.

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

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top