【问题标题】:Eclipse C++ Error "....Could not be resolved"Eclipse C++ 错误“....无法解决”
【发布时间】:2015-04-30 21:46:59
【问题描述】:

我刚刚安装了Eclipse C++,想在上面测试一些程序,我复制粘贴了一个随机代码,命名为main.cpp,运行它,出现14个错误

代码:

#include<iostream>
#include<cmath>

using namespace std;

int main() {
    int i,j,m,n,l;
    float x[10],a[10][10],b[10],c[10];
    cout<<"\nEnter the value of n : \n";
    cin>>n;
    cout<<"\nEnter the number of iterations : \n";
    cin>>l;
    cout<<"\nEnter the right hand side constants : \n";
    for(i=0;i<n;i++) {
        cin>>b[i];
    }
    cout<<"\nEnter the coefficients row wise : \n";
    for(i=0;i<n;i++) {
        x[i]=0;
        for(j=0;j<n;j++) {
            cin>>a[i][j];
        }
    }
    m=1;
    line:
    for(i=0;i<n;i++) {
        c[i]=b[i];
        for(j=0;j<n;j++) {
            if(i!=j) {
                c[i]=c[i]-a[i][j]*x[j];
            }
        }
    }
    for(i=0;i<n;i++) {
        x[i]=c[i]/a[i][i];
    }
    m++;
    if(m<=l) {
        goto line;
    }
    else {
        cout<<"\nThe Solution is : \n";
        for(i=0;i<n;i++) {
            cout<<"\nx("<<i<<") = "<<x[i]<<"\n";
        }
    }
}

错误: 在 PATH 中找不到程序“g++” 在 PATH 中找不到程序“gcc” 在 PATH 中找不到程序“make” 符号“cin”无法解析 符号“std”无法解析

【问题讨论】:

  • Eclipse 不包含 C++ 编译器和其他必要的工具。根据您的操作系统,您需要安装适当的工具。

标签: c++ eclipse


【解决方案1】:

让它工作,必须使用正确的软件包安装 cygwin:我在这里找到了一个指南: https://cs.txstate.edu/labs/tutorials/tut_docs/Installing%20Eclipse%20C++.pdf

我仍然有错误,但那是其他一些东西,在重新启动 eclipse 后用新文件创建一个新项目也可以工作,也可以省去头痛,祝你好运

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-20
    • 2015-05-09
    • 2012-10-27
    • 2016-11-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多