Comments (12)
GCC7 is too old and doesn't have full support for std::filesystem
. You will have to update to GCC8.
from matplotplusplus.
I tried to improve the documentation a little but there's not much we can do.
from matplotplusplus.
Ah I see, sorry I thought gcc 7.5.0 could use c++17, and therefore also std::filsystem. Thank you!
from matplotplusplus.
Sorry for commenting on closed thread.
For people who using has gcc 7.5.0 built in or olders (For example like Ubuntu 18.04 comes with 7.5.0), you need to first switch your compiler using update alternatives
. (Do not overwrite or directly linked it to new compiler)
This is because, for whatever reason, despite using env CXX=g++-10 cmake ..
during configuration, it will select whatever current g++ version for compilation. To check your current version, just type g++ --version
.
To be able to compile, just do as follows
sudo apt install build-essential
Then install whatever new version, for example if you want to install g++-10, then you need to do as follows
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt install g++-10
Then link the g++/gcc to update alternatives
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10
Once above is completed, then you can freely change your version as follows
update-alternatives --config g++
then select which g++ version you would like to use. The same goes to gcc.
update-alternatives --config g++
Before do cmake, make sure to delete the previous cmake generated files.
After that, you can run cmake .. <options> -DCMAKE_BUILD_TYPE=Release
.
But in case std::filesystem
is still not found, (I found in my case, most of the time things will work by deleting previous cmake generated files, e.g.: running rm -rf *
in build folder), then run
env CC=gcc-10 CXX=g++-10 cmake .. <options> -DCMAKE_BUILD_TYPE=Release
Hope this helps. It works in my case, so in case it also works for yours, please do give a thumbs up.
from matplotplusplus.
Hi @kurogane1031,
Thanks for making this summary. I'll try to move some of that to the README when I have some time.
from matplotplusplus.
I'm on gcc9 and still have this error. Any Idea?
from matplotplusplus.
On GCC9 and still Cannot run simple program using std::filesystem
? Or is it some other error now?
If you're getting Cannot run simple program using std::filesystem
with GCC9, you're probably not using GCC9 or its standard library in your project.
from matplotplusplus.
Yes. How can i find out? I am using clion on windows with mingw. Running gcc --version still says gcc9. When I tried gcc 10 I get a different error (/wd4305 no such file or directory and /uff-8 no such file or directory). Happens only when I try to use marplot++, without it everything compiles fine.
from matplotplusplus.
I though it was GCC9 on linux. I didn't know it was minnow on windows. That's an important detail.
We don't test continuous integration with mingw+windows. We usually only test macOS+clang, linux+gcc, and windows+msvc. On windows, I would just recommend using visual studio. CLion can directly use visual studio now.
On windows+mingw, the error Cannot run simple program using std::filesystem
means the standard library doesn't have the filesystem library, which is a C++17 library. The /wd4305 no such file or directory and /uff-8 no such file or directory
errors mean the build system is trying to apply the necessary MSVC options (because it's windows) but it can't because you're using mingw. The build script would need new flags and conditions to learn to differentiate windows+msvc from windows+mingw.
That's not to say it's impossible to use matplot++ with windows+mingw, but you would need to take care of these details yourself, because there are only so many combinations we can continually test in our workflows. When the compiler and its dependencies are not available, the most we can do is improve the error messages.
from matplotplusplus.
I am getting the exact same error on windows+msvc, using latest MSVS 2022.
from matplotplusplus.
Same error here, Cannot run simple program using std::filesystem
.
Linux, gcc, CMAKE_CXX_COMPILER_VERSION: 12.2.1
Adding lib using CPMAddPackage("gh:alandefreitas/[email protected]")
from matplotplusplus.
same error here. gcc 12.3.0
from matplotplusplus.
Related Issues (20)
- Build error on MacOS 12.2 and Clang 13.1 HOT 2
- Error building on linux gcc-12 HOT 5
- Small X-axis increments are not plotted correctly
- Warning: Direct2D back-end error 80070057 when plotting matrix
- Class interface seems not to add axes
- "pngcairo" doesn't use "size" option HOT 1
- Followed build and install instruction but failed to compile sample elsewhere. HOT 2
- Issue With polarscatter
- Quiet mode does not work on windows when matplot is called from a GUI application
- Plot not showing up - exit with error code 3 HOT 5
- Support for ANY ranges? HOT 2
- Heatmap labels only work for small data sets
- Adding a legend seems to cause lines to not appear on line plot, Windows, MSVC HOT 2
- Compilation errors with gcc 13.2.1, easy fix
- undefined reference to `matplot::gca()'
- glad not exported when built locally
- xrepo install matplotplusplus failed
- Add SOVERSION to shared library HOT 1
- too low precision for double data points
- I suggest adding a financial market candlestick chart library to the image gallery. Thankx.
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 matplotplusplus.