小编and*_*hia的帖子

C++错误:抛出'std :: bad_alloc'实例后调用terminate

我在eclipse上使用下面的代码,我得到一个错误终止"在抛出'std :: bad_alloc'的实例后调用what():std :: bad_alloc".

我有RectInvoice类和Invoice类.

class Invoice {
public:

    //...... other functions.....
private:
   string name;
   Mat im;
   int width;
   int height;
   vector<RectInvoice*> rectInvoiceVector; 
};
Run Code Online (Sandbox Code Playgroud)

我在Invoice的方法中使用下面的代码.

        // vect : vector<int> *vect;

        RectInvoice rect(vect,im,x, y, w ,h);
        this->rectInvoiceVector.push_back(&rect);
Run Code Online (Sandbox Code Playgroud)

我想在eclipse.ini文件中更改eclipse内存.但我没有授权这个.我怎么能这样做?

c++ memory-management runtime-error

22
推荐指数
2
解决办法
11万
查看次数

Ubuntu Eclipse libxml2错误:致命错误:libxml/xmlversion.h:没有这样的文件或目录

我想在我的eclipse项目中使用libxml2.我可以在命令行上使用这个库"

g ++ main.cpp -I/usr/include/libxml2 -lxml2 -o output"

但我不能在eclipse上使用.我添加了C++ Build-> Setting-> GCC C Compiler-> Includes

-I/usr/include/libxml2和我添加C++ Build-> Setting-> GCC C++ Linker-> library -lxml2

但是当我构建我的项目时,我收到错误

libxml/parser.h:15:31:致命错误:libxml/xmlversion.h:没有这样的文件或目录

c++ eclipse libxml2

11
推荐指数
1
解决办法
2万
查看次数

标签 统计

c++ ×2

eclipse ×1

libxml2 ×1

memory-management ×1

runtime-error ×1