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"
基础教程推荐
- GDB 显示调用堆栈上函数地址的当前编译二进制文 2022-09-05
- 我应该对 C++ 中的成员变量和函数参数使用相同的名称吗? 2021-01-01
- 为什么 RegOpenKeyEx() 在 Vista 64 位上返回错误代码 2021-01-01
- 非静态 const 成员,不能使用默认赋值运算符 2022-10-09
- 为什么 typeid.name() 使用 GCC 返回奇怪的字符以及如 2022-09-16
- 初始化列表*参数*评估顺序 2021-01-01
- 为什么派生模板类不能访问基模板类的标识符? 2021-01-01
- CString 到 char* 2021-01-01
- 如果我为无符号变量分配负值会发生什么? 2022-01-01
- 通过引用传递 C++ 迭代器有什么问题? 2022-01-01
