fatal error lnk1120: 1 unresolved externals
时间: 2023-04-28 10:05:24 浏览: 1161
"lnk1120: 1 unresolved externals" 是一个链接错误,表明在程序链接过程中有 1 个未解决的外部符号。这意味着程序引用了一个外部函数或变量,但在程序中找不到对应的定义。这可能是因为缺少某个库文件或者编译器未能找到头文件。
相关问题
fatal error LNK1120: 1 unresolved externals
This error occurs when the linker is unable to resolve a reference to an external symbol or function that is used in the code. This means that the linker is unable to find the definition of the symbol or function that is needed to link the program.
To fix this error, you need to ensure that all the necessary libraries and object files are included in the linking process. This can be done by checking the project settings and ensuring that all required files are added to the project.
You should also check that the function or symbol that is causing the error is properly defined and declared in the code. If it is not properly defined or declared, the linker will not be able to find it and you will get this error.
Finally, you can try rebuilding the entire project to ensure that all the necessary files are properly linked and that there are no other errors in the code.
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/Cpp1.exe : fatal error LNK1120: 1 unresolved externals
这个错误通常是由于缺少main函数导致的,因为main函数是C/C++程序的入口函数。请检查你的代码中是否包含了main函数,如果没有,请添加一个main函数。
另外,还有一种可能是你的项目配置不正确,导致编译器无法找到main函数。你可以尝试重新配置你的项目,确保编译器可以正确地找到main函数。如果你使用的是Visual Studio,可以检查项目属性中的配置选项,确保已经选择了正确的配置类型和平台。
阅读全文
相关推荐













