Closed cvanelteren closed 2 years ago
Clang gives a similar issue with definitions.
clang++ -I /usr/include/ -L /usr/lib/ ~/test.cpp -o test
The errors are basically saying the C++17 features, such as is_same_v and string_view, are missing. If the compiler supports C++17, you might need to turn on the C++17 flags manually or via CMAKE_CXX_STANDARD
when calling CMake.
I set c++ stdlib with set(CMAKE_CXX_STANDARD 17)
in CMakeLists.txt. After that I am getting missing symbols. Not sure how to debug the linkage error.
g++ -std=c++17 -I/usr/local/include/ test.cpp -I/usr/include -o test
You're not linking the library. Thus, the symbols are missing. See -L
compiler option or use CMake for integration. Also make sure you are using the same compiler you used to build matplot++.
I got it to compile and run
g++ -o test test.cpp /usr/lib/libmatplot.a /usr/lib/Matplot++/libnodesoup.a /usr/lib/libtiff.so /usr/lib/libjpeg.so /usr/lib/libz.a /usr/lib/libpng.so
I am not entirely sure why linking with -L
didn't work. I take it that the preferred method is to use cmake for generating plots and not one-off scripts using method above?
Yes. Having a build system is almost always the preferred method.
Thanks for the help, will take this package for a spin.
Bug category
Describe the bug
Hi,
Firstly, thanks of all for this package. I am coming from matplotlib and this looks like a nice transition. I have some issues compiling code with this package however. Using g++-11 (gcc (GCC) 11.2.0) I am getting link errors and undefined symbols. The instructions clearly state that c++17 is supported, compiling with g++-10 yields compiling errors (see block below). Could you point me in the right direction? Thanks in advance! Steps to Reproduce
where
test.cpp
isOutput
Platform
Environment Details:
Additional context