Compiling C++ Program Causes quot;Fatal Error LNK1104quot;(编译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"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:编译C++程序导致“致命错误LNK1104"


基础教程推荐
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- C++结构和函数声明。为什么它不能编译? 2022-11-07