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

编程入门 行业动态 更新时间:2024-10-09 19:23:25
本文介绍了C++ LNK1120 致命错误:1 个未解析的外部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试使用 MS Visual Studio Professional 2010 编译此代码,但它给了我一个构建错误 LNK1120 Fatal Error: 1 unresolved externals.这是代码...

I'm trying to compile this code using MS Visual Studio Professional 2010 and it's giving me a build error LNK1120 Fatal Error: 1 unresolved externals. Here's the code...

// Program Typos prints three integer numbers, sums the numbers, calculates
// the average, and prints the sum and the average of the three numbers.

#include <iostream>
#include <iomanip>
using namespace std;

const int ONE = 5;
const int TWO = 6;
const int THREE = 7;

int main ()
{
    int sum;
    float average;


    cout  << fixed  << showpoint;

    cout << setw(5) << ONE  << TWO  << THREE << endl;
    sum = ONE + TWO + THREE;
    average = sum / 3;
    cout  << " The sum is "  << sum  << " and the average is " \
      << average  <<endl;
    return 0;
}

推荐答案

唯一的可能性是缺少 WinMain(或其变体).要解决转到项目设置,链接器 -> 系统,然后选择 /SUBSYSTEM:CONSOLE.

The only possibility is missing WinMain (or its variant). To resolve goto Project Settings, Linker -> System, and select /SUBSYSTEM:CONSOLE.

这不是问题,请粘贴完整的错误信息.

It that's not the problem, kindly paste entire error message.

这篇关于C++ LNK1120 致命错误:1 个未解析的外部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-27 15:06:48,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1157107.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!