Skip to content

terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc Aborted (core dumped) #27

Description

@nagarjunvinukonda

Hello,

I am using pbplots as per the tutorial:
https://github.com/InductiveComputerScience/pbPlots/blob/master/Cpp/example1.cpp
For this new version.

The first error I get is :

error: ‘FreeAllocations’ was not declared in this scope
     FreeAllocations();

If I comment it out, I get the error:

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

This is my CMake file:

cmake_minimum_required(VERSION 3.0.2)
project(Canoo)

set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")

#SET( EIGEN3_INCLUDE_DIR "$ENV{EIGEN3_INCLUDE_DIR}" )
#SET( CMAKE_MODULE_PATH "$ENV{EIGEN3_DIR}" )

find_package(Eigen3 REQUIRED )

link_directories(${Eigen_INCLUDE_DIRS})

# include_directories is needed for the compiler to know where looking for Eigen3 header files to be included 
include_directories( "${CMAKE_CURRENT_SOURCE_DIR}/pbplots" )

add_executable(solution main.cpp pbplots/pbPlots.cpp pbplots/supportLib.cpp)

#target_link_libraries(solution eigen)

I kept all the pbplots cpp and hpp in pbplots folder in my current directory. I have no trouble in completion. But execution is trouble.

Whats the problem? though I am following exactly in the tutorial.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions