esutil icon indicating copy to clipboard operation
esutil copied to clipboard

fails to compile and install with the compiling flag -std=c++17

Open zhang-zhixiang opened this issue 4 years ago • 5 comments

When I try to install esutil in my computer using pip, The install process reports errors. The reason seems like that my compiler default C++ standard is C++17, and the c++ code includes throw exception flags that are only supported in C++11. Maybe you can add a -std=c++11 flag when compiling, or delete the exception statement in the header file. The failure report is below:

esutil/htm/htmc.h:29:36: error:ISO C++17 does not allow dynamic exception specifications 29 | HTMC(int depth=10) throw (const char *); | ^~~~~ esutil/htm/htmc.h:30:33: error:ISO C++17 does not allow dynamic exception specifications 30 | void init(int depth=10) throw (const char *); | ^~~~~ esutil/htm/htmc.h:39:11: error:ISO C++17 does not allow dynamic exception specifications 39 | ) throw (const char *); | ^~~~~ esutil/htm/htmc.h:46:30: error:ISO C++17 does not allow dynamic exception specifications 46 | ) throw (const char *); | ^~~~~ esutil/htm/htmc.h:78:31: error:ISO C++17 does not allow dynamic exception specifications 78 | throw (const char *); | ^~~~~ esutil/htm/htmc.h:100:32: error:ISO C++17 does not allow dynamic exception specifications 100 | PyObject* dec) throw (const char *);

zhang-zhixiang avatar Nov 26 '21 14:11 zhang-zhixiang

Thanks for the report.

What system are you using that defaults to C++17?

esheldon avatar Nov 30 '21 12:11 esheldon

My system is Manjaro, and gcc version is 11.1.0

zhang-zhixiang avatar Nov 30 '21 13:11 zhang-zhixiang

I got the same error. I'm using fedora fc 34. Redhat switched to g++17 a year ago (https://developers.redhat.com/articles/2021/08/06/porting-your-code-c17-gcc-11#). Would it be possible to adjust the code? Thanks

aschrimpf avatar Apr 20 '22 14:04 aschrimpf

This broke using clang on osx. I think we need to only do this on linux.

beckermr avatar Jan 08 '23 12:01 beckermr

This can probably be closed now?

jobovy avatar Aug 23 '23 00:08 jobovy