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

2022-01-04 00:00:00 visual-studio compilation c++

我正在尝试在命令提示符下使用以下命令编译 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"

相关文章