Code Monkey home page Code Monkey logo

Comments (6)

DrRamm avatar DrRamm commented on July 27, 2024

I faced with same error(

[dr@ramm matplotlib-cpp]$ make
cd examples && g++ minimal.cpp -lpython2.7 -o minimal -std=c++11
cd examples && g++ basic.cpp -lpython2.7 -o basic
cd examples && g++ modern.cpp -lpython2.7 -o modern -std=c++11
[dr@ramm matplotlib-cpp]$ ls examples
basic basic.cpp basic.png minimal minimal.cpp minimal.png modern modern.cpp modern.png
[dr@ramm matplotlib-cpp]$ examples/basic
Segmentation fault (core dumped)

from matplotlib-cpp.

lava avatar lava commented on July 27, 2024

Maybe you could run it in gdb and post a backtrace of the place where the segmentation fault occurs?

from matplotlib-cpp.

DrRamm avatar DrRamm commented on July 27, 2024

[dr@ramm matplotlib-cpp]$ ls
examples img img.cpp LICENSE LICENSE.matplotlib Makefile matplotlibcpp.h README.md
[dr@ramm matplotlib-cpp]$ cd examples
[dr@ramm examples]$ ls
basic basic.cpp basic.png minimal minimal.cpp minimal.png modern modern.cpp modern.png
[dr@ramm examples]$ ./minimal
Ошибка сегментирования (стек памяти сброшен на диск)
[dr@ramm examples]$ gdb ./minimal
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./minimal...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/dr/Documents/tgbot/matplotlib-cpp/examples/minimal
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000000000002230 in ?? ()
(gdb)

upd
Seems like i found error
(gdb) list
1 /build/gcc/src/gcc/libquadmath/math/x2y2m1q.c: Not such file or folder

from matplotlib-cpp.

lava avatar lava commented on July 27, 2024

Well, you're almost there :) Just

  1. Make sure you have checked out the latest commit without modifications
  2. Add -g3 to your compiler flags when compiling minimal.cpp
  3. Where you used the list command in gdb, use backtrace instead

from matplotlib-cpp.

DrRamm avatar DrRamm commented on July 27, 2024

thanks a lot, smthng weird with env on my OS, solved

from matplotlib-cpp.

carlosal1015 avatar carlosal1015 commented on July 27, 2024

With this example, is showed the Segmentation fault

#include <matplotlib-cpp/matplotlibcpp.h>

namespace plt = matplotlibcpp;

int main()
{
  std::vector<double> x = {1.5, 2.5, 3.5, 4.5},
                      y = {1, 3, 2, 4};

  plt::figure();
  plt::plot(x, y, "bo-");
  plt::xlabel("time [s]");
  plt::ylabel("observations [m]");
  plt::title("Matplotlib minimal example");
  plt::legend();
  plt::show();
  // plt::save("plot.png");

  return 0;
}

image

from matplotlib-cpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.