简体   繁体   English

Borland C ++ Builder 6上的奇怪链接器错误

[英]Weird linker error on Borland C++ Builder 6

I've been trying to compile a Borland C++ Builder 6 project, but linker dies with exact following error: 我一直在尝试编译Borland C ++ Builder 6项目,但是链接器死于以下确切错误:

[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. 感谢帮助。

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). 如果找不到任何内容,请在此处发布您的链接器命令行(在“项目->选项->链接器->命令行”中找不到我的头)。

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. 我从未使用过Borland C ++ Builder,但这听起来像是一个损坏的项目或一个损坏的目标文件-我想您没有任何编译错误。 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? 我以前曾在Visual Studio中看到过这种情况,通常如果在链接过程中停止编译器构建时,是否不确定borland在链接过程中是否生成obj文件? have a search in your project directory, and delete the obj files possibly in a folder called "intermediate" and try again 在您的项目目录中进行搜索,然后删除obj文件(可能位于名为“ intermediate”的文件夹中),然后重试

我怀疑命令行上有空格或其他字符,例如-或+。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM