GCC“内部编译器错误:重新输入错误报告例程”(包括完整代码)

Posted

技术标签:

【中文标题】GCC“内部编译器错误:重新输入错误报告例程”(包括完整代码)【英文标题】:GCC "Internal compiler error: Error reporting routines re-entered" (full code included) 【发布时间】:2013-11-03 18:02:14 【问题描述】:

当我构建我的项目时,编译器会输出以下内容(底部的错误消息)。我从 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;

【问题讨论】:

编译器版本?你检查过 bugzilla 吗? 什么增强版本?尝试不同版本的 boost...他们总是为编译器错误添加新的解决方法。 【参考方案1】:

Internal compiler error 表示编译器中存在错误 - 这不是您的代码的问题,尽管它可能由您正在执行的操作触发。

可能与此already reported bug 相关。

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

【讨论】:

我正在使用 GCC 和 G++ 4.7 :( ... ? 如果您不需要 4.7 提供的任何新功能,也可以尝试早期版本。 @PeterAlexander 我至少需要 4.7,因为我使用的是 c++11 功能。

以上是关于GCC“内部编译器错误:重新输入错误报告例程”(包括完整代码)的主要内容,如果未能解决你的问题,请参考以下文章

[ubuntu][GCC]gcc源码编译

使用自定义 gcc 位置构建包

使用自定义gcc位置构建包

linux下离线安装gcc详细教程

较小的 GCC 包,只需要 C [关闭]

LINUX安装GCC出现的问题