编译C++程序导致“致命错误LNK1104"

2023-10-17C/C++开发问题
4

本文介绍了编译C++程序导致“致命错误LNK1104"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我正在尝试在命令提示符下使用以下命令编译 C++ 应用程序:

I am trying to compile a c++ application using the following command in command prompt:

cl -I"c:Program filesJavajdk1.5.0_07include" -I"c:program filesjavajdk1.5.0_07includewin32" -MD -LD HelloWorld.cpp -FeHelloWorld.dll

然而,这会产生以下错误:

However, this produces the following error:

链接:致命错误 LNK1104:无法打开文件MSVCRT.lib"

LINK : fatal error LNK1104: cannot open file 'MSVCRT.lib'

您对导致这种情况的原因以及解决方法有任何想法吗?

Have you any ideas of what is causing this and how to fix it?

我在 Windows 上安装了 Visual Studio 2005.

I have visual studio 2005 installed on windows.

谢谢,

-皮特

推荐答案

链接:致命错误 LNK1104:无法打开文件MSVCRT.lib"

LINK : fatal error LNK1104: cannot open file 'MSVCRT.lib'

关于是什么导致这种情况以及如何解决它的任何想法?

Any ideas of what is causing this and how to fix it?

链接器需要指向 MSVCRT.lib 的位置,因为它似乎不在您的 LIBPATH 中.

The linker needs to be pointed to the location of MSVCRT.lib, as it doesn't seem to be in your LIBPATH.

它应该在这里:C:Program FilesMicrosoft Visual Studio 7VClib

添加-link -LIBPATH:C:Program FilesMicrosoft Visual Studio 8VClib"

这篇关于编译C++程序导致“致命错误LNK1104"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

无法访问 C++ std::set 中对象的非常量成员函数
Unable to access non-const member functions of objects in C++ std::set(无法访问 C++ std::set 中对象的非常量成员函数)...
2024-08-14 C/C++开发问题
17

从 lambda 构造 std::function 参数
Constructing std::function argument from lambda(从 lambda 构造 std::function 参数)...
2024-08-14 C/C++开发问题
25

STL BigInt 类实现
STL BigInt class implementation(STL BigInt 类实现)...
2024-08-14 C/C++开发问题
3

使用 std::atomic 和 std::condition_variable 同步不可靠
Sync is unreliable using std::atomic and std::condition_variable(使用 std::atomic 和 std::condition_variable 同步不可靠)...
2024-08-14 C/C++开发问题
17

在 STL 中将列表元素移动到末尾
Move list element to the end in STL(在 STL 中将列表元素移动到末尾)...
2024-08-14 C/C++开发问题
9

为什么禁止对存储在 STL 容器中的类重载 operator&()?
Why is overloading operatoramp;() prohibited for classes stored in STL containers?(为什么禁止对存储在 STL 容器中的类重载 operatoramp;()?)...
2024-08-14 C/C++开发问题
6