alphaAXLE 2022-12-12 11:57 采纳率: 100%
浏览 24
已结题

CLion大错误 怎么办?

最近遇到一个问题……
我是主攻前端的,但后端也不是不会,最近在用据说是最好的C++编译器CLion,然后就出错了!

#include <iostream>
using namespace std;

int n, m, x, sum = 0;

struct student {
    int id, score;
};

int main() {
    student st[32767];
    cin >> n >> m;
    for (int i = 0; i <= n - 1; i++) {
        cin >> st[i].id >> st[i].score;
    }

    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            if (st[i].score > st[j].score) {
                swap(st[i], st[j]);
            } else if (st[i].score == st[j].score) {
                if (st[i].id < st[j].id) {
                    swap(st[i], st[j]);
                }
            }
        }
    }
    x = m / 10 * 15;
    for (int i = 0; i < n; i++) {
        if (st[i].score >= x) {
            sum++;
        }
    }
    cout << x << sum << endl;
    return 0;
}


这代码应该是没问题的,但就是运行不了(悲)
它报的这个错:

====================[ Build | C___Practice | Debug ]============================
"E:\NO NAME\SOFTWARES\CLion 2022.3\bin\cmake\win\bin\cmake.exe" --build "E:\NO NAME\PROGRAMMING\C++-Practice\cmake-build-debug" --target C___Practice -j 3
[1/1] Linking CXX executable C___Practice.exe
FAILED: C___Practice.exe
cmd.exe /C "cd . && E:\NONAME1\SOFTWA1\CLION21.3\bin\mingw\bin\G__1.EXE -g CMakeFiles/C___Practice.dir/HelloWorld.cpp.obj CMakeFiles/C___Practice.dir/Contests/Score_Judging.cpp.obj -o C___Practice.exe -Wl,--out-implib,libC___Practice.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 && cd ."
E:\NO NAME\SOFTWARES\CLion 2022.3\bin\mingw\bin/ld.exe: CMakeFiles/C___Practice.dir/Contests/Score_Judging.cpp.obj:E:/NO NAME/PROGRAMMING/C++-Practice/Contests/Score Judging.cpp:10: multiple definition of `main'; CMakeFiles/C___Practice.dir/HelloWorld.cpp.obj:E:/NO NAME/PROGRAMMING/C++-Practice/HelloWorld.cpp:4: first defined here
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
哪位高人能帮我解答下?本蒟蒻会感激涕零!

  • 写回答

2条回答 默认 最新

  • alphaAXLE 2023-01-18 20:11
    关注

    问题已经解决了。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 1月26日
  • 已采纳回答 1月18日
  • 创建了问题 12月12日

悬赏问题

  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来