为什么致命错误“LNK1104:无法打开文件'C:Program.obj'"?当我在 Visual Studio 中编译 C++ 项目时发生? [英] Why does fatal error "LNK1104: cannot open file 'C:Program.obj'" occur when I compile a C++ project in Visual Studio?
问题描述
我在 Visual Studio 2008 中创建了一个新的 C++ 项目.尚未编写任何代码;仅更改了项目设置.
I've created a new C++ project in Visual Studio 2008. No code has been written yet; Only project settings have been changed.
当我编译项目时,我收到以下致命错误:
When I compile the project, I receive the following fatal error:
致命错误 LNK1104:无法打开文件 'C:Program.obj'
fatal error LNK1104: cannot open file 'C:Program.obj'
推荐答案
此特定问题是由于指定了对路径中有空格的 lib 文件的依赖关系.路径需要用引号括起来才能正确编译项目.
This particular issue is caused by specifying a dependency to a lib file that had spaces in its path. The path needs to be surrounded by quotes for the project to compile correctly.
关于配置属性->链接器->项目属性的输入选项卡,有一个Additional Dependencies属性.此问题已通过添加引号得到解决.例如,将此属性更改为:
On the Configuration Properties -> Linker -> Input tab of the project’s properties, there is an Additional Dependencies property. This issue was fixed by adding the quotes. For example, changing this property from:
C:Program Files软件sdkliblibrary.lib
C:Program Filessofware sdkliblibrary.lib
收件人:
"C:Program Files软件sdkliblibrary.lib"
"C:Program Filessofware sdkliblibrary.lib"
我在哪里添加了引号.
这篇关于为什么致命错误“LNK1104:无法打开文件'C:Program.obj'"?当我在 Visual Studio 中编译 C++ 项目时发生?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!