Comments (6)
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.
Maybe you could run it in gdb and post a backtrace of the place where the segmentation fault occurs?
from matplotlib-cpp.
[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.
Well, you're almost there :) Just
- Make sure you have checked out the latest commit without modifications
- Add
-g3
to your compiler flags when compiling minimal.cpp - Where you used the
list
command in gdb, usebacktrace
instead
from matplotlib-cpp.
thanks a lot, smthng weird with env on my OS, solved
from matplotlib-cpp.
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;
}
from matplotlib-cpp.
Related Issues (20)
- Python.h: No such file or directory even after using "quick fix" HOT 1
- Writing mathematical expressions
- Thank your share for matplot in cpp,it is very convenient!But i can't find the method for draw a rectangle,how can i draw a rectan?
- error C2766 HOT 1
- Delete this issue, pls
- Undefined symbols for architecture arm64:.... HOT 5
- Embed plot into Qwidget HOT 1
- make length_includes_head available for arrow
- /usr/bin/ld: cannot find -lmatplotlib_cpp: No such file or directory HOT 1
- Plot3 and Plot_Surface window cannot be updated with new data in loops HOT 1
- 3D line plot not showing any data
- Segmentation fault (core dumped) after successfully executing compiled file HOT 1
- Fails to link when using Python2.7(Undefined ref to Py_dealloc) but works when linking with Python 3.9
- Using extent with imshow
- Option to get a transparent background when saving figure?
- #include "matplotlibcpp.h" namespace plt = matplotlibcpp; int main() { plt::plot({1,3,2,4}); plt::show(); }
- The 3D example does not work. HOT 2
- Unable to compile examples on MacOS
- Multiple definition issue HOT 1
- Performance vs python's MPL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matplotlib-cpp.