alandefreitas / matplotplusplus

Matplot++: A C++ Graphics Library for Data Visualization 📊🗾
https://alandefreitas.github.io/matplotplusplus/
MIT License
4.1k stars 311 forks source link

Build error on MacOS 12.2 and Clang 13.1 #361

Open denniskb opened 1 year ago

denniskb commented 1 year ago

Bug category

Describe the bug

matplot++ v1.2.0 fails to build out of the box on MacOS 12.2.1 / Clang 13.1.6.

Steps to Reproduce

git clone ...
cd marplotplusplus
git checkout v1.2.0
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make

Output

```console ... [ 23%] Built target nodesoup [ 25%] Building CXX object 3rdparty/matplot/source/matplot/CMakeFiles/matplot.dir/core/line_spec.cpp.o /Users/dbautembach/kraken/3rdparty/matplot/source/matplot/core/line_spec.cpp:76:32: error: no viable overloaded '=' custom_marker_ = u8"▶"; ~~~~~~~~~~~~~~ ^ ~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:905:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'const std::string' for 1st argument basic_string& operator=(const basic_string& __str); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:908:19: note: candidate template ignored: substitution failure [with _Tp = char8_t [4]]: no member named '_EnableIfImpl' in 'std::_MetaBase' basic_string& operator=(const _Tp& __t) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:913:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'std::string' for 1st argument basic_string& operator=(basic_string&& __str) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:916:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'initializer_list::value_type>' (aka 'initializer_list') for 1st argument basic_string& operator=(initializer_list __il) {return assign(__il.begin(), __il.size());} ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:918:45: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'const std::basic_string::value_type *' (aka 'const char *') for 1st argument _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);} ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:922:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'std::basic_string::value_type' (aka 'char') for 1st argument basic_string& operator=(value_type __c); ^ /Users/dbautembach/kraken/3rdparty/matplot/source/matplot/core/line_spec.cpp:80:32: error: no viable overloaded '=' custom_marker_ = u8"◀"; ~~~~~~~~~~~~~~ ^ ~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:905:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'const std::string' for 1st argument basic_string& operator=(const basic_string& __str); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:908:19: note: candidate template ignored: substitution failure [with _Tp = char8_t [4]]: no member named '_EnableIfImpl' in 'std::_MetaBase' basic_string& operator=(const _Tp& __t) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:913:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'std::string' for 1st argument basic_string& operator=(basic_string&& __str) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:916:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'initializer_list::value_type>' (aka 'initializer_list') for 1st argument basic_string& operator=(initializer_list __il) {return assign(__il.begin(), __il.size());} ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:918:45: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'const std::basic_string::value_type *' (aka 'const char *') for 1st argument _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);} ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:922:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'std::basic_string::value_type' (aka 'char') for 1st argument basic_string& operator=(value_type __c); ^ /Users/dbautembach/kraken/3rdparty/matplot/source/matplot/core/line_spec.cpp:392:28: error: no viable overloaded '=' custom_marker_ = u8"▶"; ~~~~~~~~~~~~~~ ^ ~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:905:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'const std::string' for 1st argument basic_string& operator=(const basic_string& __str); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:908:19: note: candidate template ignored: substitution failure [with _Tp = char8_t [4]]: no member named '_EnableIfImpl' in 'std::_MetaBase' basic_string& operator=(const _Tp& __t) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:913:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'std::string' for 1st argument basic_string& operator=(basic_string&& __str) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:916:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'initializer_list::value_type>' (aka 'initializer_list') for 1st argument basic_string& operator=(initializer_list __il) {return assign(__il.begin(), __il.size());} ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:918:45: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'const std::basic_string::value_type *' (aka 'const char *') for 1st argument _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);} ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:922:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'std::basic_string::value_type' (aka 'char') for 1st argument basic_string& operator=(value_type __c); ^ /Users/dbautembach/kraken/3rdparty/matplot/source/matplot/core/line_spec.cpp:396:28: error: no viable overloaded '=' custom_marker_ = u8"◀"; ~~~~~~~~~~~~~~ ^ ~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:905:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'const std::string' for 1st argument basic_string& operator=(const basic_string& __str); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:908:19: note: candidate template ignored: substitution failure [with _Tp = char8_t [4]]: no member named '_EnableIfImpl' in 'std::_MetaBase' basic_string& operator=(const _Tp& __t) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:913:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'std::string' for 1st argument basic_string& operator=(basic_string&& __str) ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:916:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'initializer_list::value_type>' (aka 'initializer_list') for 1st argument basic_string& operator=(initializer_list __il) {return assign(__il.begin(), __il.size());} ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:918:45: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'const std::basic_string::value_type *' (aka 'const char *') for 1st argument _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);} ^ /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include/c++/v1/string:922:19: note: candidate function not viable: no known conversion from 'const char8_t [4]' to 'std::basic_string::value_type' (aka 'char') for 1st argument basic_string& operator=(value_type __c); ^ 4 errors generated. make[2]: *** [3rdparty/matplot/source/matplot/CMakeFiles/matplot.dir/core/line_spec.cpp.o] Error 1 make[1]: *** [3rdparty/matplot/source/matplot/CMakeFiles/matplot.dir/all] Error 2 make: *** [all] Error 2 ```

Platform

Environment Details:

Additional context

denniskb commented 1 year ago

Adding set_target_properties(matplot PROPERTIES CXX_STANDARD 17) resolved the error.

alandefreitas commented 1 year ago

You can try git checkout master to check if the error is still there.