小编ghs*_*res的帖子

尝试在类中使用 std::vector::push_back 时获取“_throw_bad_array_new_lengthv”

我正在用 C++ 创建一个自定义语言解析器,我正在努力解决运行时错误,其中我有一个std::vector<std::string>带有构造函数的类的成员。完整的错误是:

The procedure entry point
_ZSt28__throw_bad_array_new_lengthv could no be located
in the dynamic link library
"path_to_executable"
Run Code Online (Sandbox Code Playgroud)

每当我尝试在代码中使用 std::vector::push_back 时,都会引发此错误,但 std::vector 不应该是动态大小的数据容器吗?为什么会出现这个错误?

我的一些代码:

The procedure entry point
_ZSt28__throw_bad_array_new_lengthv could no be located
in the dynamic link library
"path_to_executable"
Run Code Online (Sandbox Code Playgroud)
//"lib/cursor.h"

#ifndef T_CURSOR
#define T_CURSOR

#include <iostream>

struct Cursor
{
private:
    std::string input;
    int inputLength;

    char getChar(int p);

public:
    char character;
    int pos;
    int line;
    int column;
    bool eof;
    bool lineBreak;

    Cursor(std::string i);

    void walk(bool back = false);
    void …
Run Code Online (Sandbox Code Playgroud)

c++ runtime-error stdvector

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

标签 统计

c++ ×1

runtime-error ×1

stdvector ×1