c++ - GCC "Internal compiler error: Error reporting routines re-entered"(包含完整代码)

标签 c++ linux visual-studio gcc c++11

当我构建我的项目时,编译器输出以下内容(错误消息在底部)。我从 Visual Studio 移植了代码(使用英特尔编译器时它编译得很好)。

有人可以帮忙吗?

CLEAN SUCCESSFUL (total time: 70ms)

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/media/New Volume/Project/Proj'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/Proj
make[2]: Entering directory `/media/New Volume/Project/Proj'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/ABS.o.d
g++ -m64   -c -g -I/usr/include/boost -I/usr/include -std=c++11 -MMD -MP -MF build/Debug/GNU-Linux-x86/ABS.o.d -o build/Debug/GNU-Linux-x86/ABS.o ABS.cpp
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/Drv.o.d
g++ -m64   -c -g -I/usr/include/boost -I/usr/include -std=c++11 -MMD -MP -MF build/Debug/GNU-Linux-x86/Drv.o.d -o build/Debug/GNU-Linux-x86/Drv.o Drv.cpp
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/FD.o.d
g++ -m64   -c -g -I/usr/include/boost -I/usr/include -std=c++11 -MMD -MP -MF build/Debug/GNU-Linux-x86/FD.o.d -o build/Debug/GNU-Linux-x86/FD.o FD.cpp
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/FM.o.d
g++ -m64   -c -g -I/usr/include/boost -I/usr/include -std=c++11 -MMD -MP -MF build/Debug/GNU-Linux-x86/FM.o.d -o build/Debug/GNU-Linux-x86/FM.o FM.cpp
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/Fin.o.d
g++ -m64   -c -g -I/usr/include/boost -I/usr/include -std=c++11 -MMD -MP -MF build/Debug/GNU-Linux-x86/Fin.o.d -o build/Debug/GNU-Linux-x86/Fin.o Fin.cpp
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/Fut.o.d
g++ -m64   -c -g -I/usr/include/boost -I/usr/include -std=c++11 -MMD -MP -MF build/Debug/GNU-Linux-x86/Fut.o.d -o build/Debug/GNU-Linux-x86/Fut.o Fut.cpp
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/Idx.o.d
g++ -m64   -c -g -I/usr/include/boost -I/usr/include -std=c++11 -MMD -MP -MF build/Debug/GNU-Linux-x86/Idx.o.d -o build/Debug/GNU-Linux-x86/Idx.o Idx.cpp
‘
Internal compiler error: Error reporting routines re-entered.

这是 Idx 头文件和源文件(我认为是 Idx 引起的??):

#ifndef Idx_H
#define Idx_H


#include "Stk.h"

#include <vector>
#include <unordered_map>
#include <string>
#include <boost/shared_ptr.hpp>

using namespace std;

class Idx
{
    public:
        Idx();
        Idx(string sid);
        Idx(string sid, vector<boost::shared_ptr<Stk> > IdxInstslist, unordered_map<string,double> Idxweights);
                ~Idx();

        vector<boost::shared_ptr<Stk> > getIdxInstsList();
        void addInstToIdx(boost::shared_ptr<Stk> s, double weight);
        void setIdxInstsList(vector<boost::shared_ptr<Stk> > indinstrlist);
        double getIdxStockweight(string sid);

    private:
        vector<boost::shared_ptr<Stk> > IdxInstslist;
        unordered_map<string,double> Idxweightsdict;
        string sid;
};

#endif

和来源:

#include "Idx.h"

Idx::Idx(){}

Idx::Idx(string id){
    sid = id;
}

Idx::Idx(string id,vector<boost::shared_ptr<Stk> > IdxInstlist, unordered_map<string,double> Idxweights){
    sid = id;
    IdxInstslist = IdxInstlist;
    Idxweightsdict = Idxweights;
}

Idx::~Idx(){}

void Idx::addInstToIdx(boost::shared_ptr<Stk>  s, double weight){
    if(Idxweightsdict.count(s->getSecurityID())==0)
    {
        IdxInstslist.push_back(s);
        Idxweightsdict[s->getSecurityID()] = weight;
    }
}

vector<boost::shared_ptr<Stk> > Idx::getIdxInstsList(){
    return IdxInstslist;
}

void Idx::setIdxInstsList(vector<boost::shared_ptr<Stk> > indinstrlist){
    IdxInstslist = indinstrlist;
}

double Idx::getIdxStockweight(string sid){
    double weight = 0;

    if(Idxweightsdict.count(sid) == 1){
        weight = Idxweightsdict[sid];
    }
    else
    {
        cout << "Cannot retrieve Idx weight for Inst not part of Idx" << endl;
    }

    return weight;
}

最佳答案

Internal compiler error 表示编译器中存在错误——这不是您的代码的问题,尽管它可能是由您正在做的事情触发的。

可能与此有关 already reported bug .

您可以尝试获取更高版本的编译器,或者如果可能的话,只使用不同版本的编译器。

关于c++ - GCC "Internal compiler error: Error reporting routines re-entered"(包含完整代码),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19756125/

相关文章:

c++ - C++ cout和cin执行错误: main.cpp: In function ‘int main()’

linux - 如何将 docker registry default 从 docker.io 更改为 centos 中的另一个地址

visual-studio - 如何将 Visual Studio 2005/2008 项目转换为 Visual Studio 6

c# - 是否可以分析单元测试的内存使用情况?

c# - 您可以从 Application.DoEvents() 内部捕获异常吗?

c# - 如何为 64 位应用程序注册 .NET DLL

c++ - 分配用 new 声明的 vector 中的元素。 C++

python - 获取纳秒级精度的文件修改时间

c++ - 使用 CMake 包含共享库 (.so)

linux - 与 C++ 初始值设定项有关的内存一致性