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

时间:2021-01-08 04:51:30

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.

它实际上是其中一个源文件中的无效编译器指令,导致链接器命令行被破坏。感谢帮助。

4 个解决方案

#1


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).

如果找不到,请在此处发布您的链接器命令行(在Project - > Options - > Linker - > Command Line中找到我的头顶)。

#2


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).

我从来没有使用Borland C ++ Builder,但这可能听起来像一个破碎的项目或损坏的目标文件 - 我猜你没有任何编译错误。您可能需要采取以下几个步骤: - 重建项目 - 检查用于调用链接器的确切命令行,并在自定义项目设置中查找奇怪的东西(存在这样的事情)。

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.

如果你确实在命令行中发现了一些奇怪的东西,手工编辑项目文件(孩子,不要在家里这样做)去除有问题的部分可能是构建新项目之前的最后手段。

#3


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

我之前在使用visual studio看过这个,通常如果我在链接过程中停止编译器构建,不确定borland是否在链接过程中生成obj文件?在项目目录中搜索,并删除可能位于名为“intermediate”的文件夹中的obj文件,然后重试

#4


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

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

#1


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).

如果找不到,请在此处发布您的链接器命令行(在Project - > Options - > Linker - > Command Line中找到我的头顶)。

#2


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).

我从来没有使用Borland C ++ Builder,但这可能听起来像一个破碎的项目或损坏的目标文件 - 我猜你没有任何编译错误。您可能需要采取以下几个步骤: - 重建项目 - 检查用于调用链接器的确切命令行,并在自定义项目设置中查找奇怪的东西(存在这样的事情)。

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.

如果你确实在命令行中发现了一些奇怪的东西,手工编辑项目文件(孩子,不要在家里这样做)去除有问题的部分可能是构建新项目之前的最后手段。

#3


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

我之前在使用visual studio看过这个,通常如果我在链接过程中停止编译器构建,不确定borland是否在链接过程中生成obj文件?在项目目录中搜索,并删除可能位于名为“intermediate”的文件夹中的obj文件,然后重试

#4


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

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