1

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

1 回答 1

2

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

可能与此已报告的错误有关。

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

于 2013-11-03T18:21:21.543 回答