Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/148.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Visual C致命错误LNK1120:1个未解析的外部_C++ - Fatal编程技术网

C++ Visual C致命错误LNK1120:1个未解析的外部

C++ Visual C致命错误LNK1120:1个未解析的外部,c++,C++,如果你不知道有什么问题,我们将非常感谢你的帮助。 我想我的文件源有问题,但不确定 1>------ Build started: Project: Assignment 08 ADL, Configuration: Debug Win32 ------ 1>Build started 3/18/2013 8:37:38 PM. 1>InitializeBuildStatus: 1> Touching "Debug\Assignment 08 ADL.unsuccessf

如果你不知道有什么问题,我们将非常感谢你的帮助。 我想我的文件源有问题,但不确定

1>------ Build started: Project: Assignment 08 ADL, Configuration: Debug Win32 ------
1>Build started 3/18/2013 8:37:38 PM.
1>InitializeBuildStatus:
1>  Touching "Debug\Assignment 08 ADL.unsuccessfulbuild".
1>ClCompile:
1>  Assignment 08 ADL.cpp
1>  Generating Code...
1>  Skipping... (no relevant changes detected)
1>  student.cpp
1>ManifestResourceCompile:
1>  All outputs are up-to-date.
1>Assignment 08 ADL.obj : error LNK2019: unresolved external symbol "long __cdecl    decimals(class std::basic_ostream<char,struct std::char_traits<char> > &,int)" (? decimals@@YAJAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@H@Z) referenced in function "void __cdecl display(class student)" (?display@@YAXVstudent@@@Z)
1>J:\CO 127\Assignment 08 ADL\Debug\Assignment 08 ADL.exe : fatal error LNK1120: 1 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:24.82
1>----构建已启动:项目:分配08 ADL,配置:调试Win32------
1> 建造开始于2013年3月18日下午8:37:38。
1> 初始化BuildStatus:
1> 触摸“调试\分配08 ADL.unsuccessfulbuild”。
1> CLC编译:
1> 作业08 ADL.cpp
1> 正在生成代码。。。
1> 跳过。。。(未检测到相关更改)
1> student.cpp
1> 资源汇编:
1> 所有输出都是最新的。
1> 作业08 ADL.obj:错误LNK2019:未解析的外部符号“long\u cdecl小数(类std::basic\u ostream&,int)”(?小数@@YAJAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@H@Z)在函数“void\uu cdecl display(类学生)”中引用(?display@@YAXVstudent@@@Z)
1> J:\CO 127\Assignment 08 ADL\Debug\Assignment 08 ADL.exe:致命错误LNK1120:1未解析的外部
1>
1> 生成失败。
1>
1> 时间流逝00:00:24.82

LNK 2019错误是链接器错误,通常意味着链接器无法使用某些对象。尝试清理重建项目,然后尝试执行它。

您需要查看
LNK1120
上方的行,
LNK2019
错误告诉您出了什么问题


void display(class student)
函数中,您正在调用名为
decimals
的函数,该函数未在源代码或库中定义。

当我添加.c文件而不是.cpp时,我发现了这个问题
因此,还要检查文件名

确保外部变量能够在当前文件中访问。 用于测试
简单的方法是声明相同名称的局部变量,用于测试逻辑是否正常工作,稍后更改并尝试访问外部变量

感谢大家的帮助。问题在于我的#include“COMPFUN.H”全部用小写,出于某种原因,我将其改为大写。COMPFUN.H文件就是包含我的十进制函数的文件