Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error on centos #310

Closed
dchiu911 opened this issue Nov 28, 2022 · 7 comments · Fixed by #329
Closed

Installation error on centos #310

dchiu911 opened this issue Nov 28, 2022 · 7 comments · Fixed by #329

Comments

@dchiu911
Copy link

I'm having trouble building from source on centos, getting the following error:

end of install log
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘const string {aka const class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11.hpp:11:0,
                 from ./clock.h:15,
                 from ./locale.h:4,
                 from /usr/include/c++/4.8.2/clocale:42,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/function.hpp: In function ‘void cpp11::message(const string&)’:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/function.hpp:109:66: error: invalid use of incomplete type ‘const string {aka const class std::basic_string<char>}’
 inline void message(const std::string& fmt_arg) { message(fmt_arg.c_str()); }
                                                                  ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘const string {aka const class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11.hpp:11:0,
                 from ./clock.h:15,
                 from ./locale.h:4,
                 from /usr/include/c++/4.8.2/clocale:42,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/function.hpp: In function ‘void cpp11::message(const string&, Args ...)’:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/function.hpp:113:18: error: invalid use of incomplete type ‘const string {aka const class std::basic_string<char>}’
   message(fmt_arg.c_str(), args...);
                  ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘const string {aka const class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11.hpp:12:0,
                 from ./clock.h:15,
                 from ./locale.h:4,
                 from /usr/include/c++/4.8.2/clocale:42,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/integers.hpp: In function ‘cpp11::integers cpp11::as_integers(cpp11::sexp)’:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/integers.hpp:161:69: error: no matching function for call to ‘std::runtime_error::runtime_error(const char [34])’
         throw std::runtime_error("All elements must be integer-like");
                                                                     ^
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/integers.hpp:161:69: note: candidates are:
In file included from /usr/include/c++/4.8.2/array:38:0,
                 from /usr/include/c++/4.8.2/tuple:39,
                 from /usr/include/c++/4.8.2/functional:55,
                 from /usr/include/c++/4.8.2/bits/stl_algo.h:66,
                 from /usr/include/c++/4.8.2/algorithm:62,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/tzdb/include/date/date.h:44,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/tzdb/include/tzdb/date.h:5,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/tzdb/include/tzdb/tzdb.h:4,
                 from ./clock.h:5,
                 from ./locale.h:4,
                 from /usr/include/c++/4.8.2/clocale:42,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/stdexcept:119:5: note: std::runtime_error::runtime_error(const string&)
     runtime_error(const string& __arg);
     ^
/usr/include/c++/4.8.2/stdexcept:119:5: note:   no known conversion for argument 1 from ‘const char [34]’ to ‘const string& {aka const std::basic_string<char>&}’
/usr/include/c++/4.8.2/stdexcept:112:9: note: constexpr std::runtime_error::runtime_error(const std::runtime_error&)
   class runtime_error : public exception
         ^
/usr/include/c++/4.8.2/stdexcept:112:9: note:   no known conversion for argument 1 from ‘const char [34]’ to ‘const std::runtime_error&’
In file included from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11.hpp:14:0,
                 from ./clock.h:15,
                 from ./locale.h:4,
                 from /usr/include/c++/4.8.2/clocale:42,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/list_of.hpp: In member function ‘T cpp11::list_of<T>::operator[](const string&)’:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/list_of.hpp:23:69: error: invalid use of incomplete type ‘const string {aka const class std::basic_string<char>}’
   T operator[](const std::string& pos) { return list::operator[](pos.c_str()); }
                                                                     ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘const string {aka const class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11.hpp:14:0,
                 from ./clock.h:15,
                 from ./locale.h:4,
                 from /usr/include/c++/4.8.2/clocale:42,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/list_of.hpp: In member function ‘cpp11::writable::list_of<T>::proxy cpp11::writable::list_of<T>::operator[](const string&)’:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/list_of.hpp:66:42: error: invalid use of incomplete type ‘const string {aka const class std::basic_string<char>}’
     return writable::list::operator[](pos.c_str());
                                          ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘const string {aka const class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11.hpp:24:0,
                 from ./clock.h:15,
                 from ./locale.h:4,
                 from /usr/include/c++/4.8.2/clocale:42,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/strings.hpp: In function ‘bool cpp11::writable::operator==(const cpp11::writable::r_vector<cpp11::r_string>::proxy&, cpp11::r_string)’:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/strings.hpp:69:76: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
   return static_cast<r_string>(lhs).operator==(static_cast<std::string>(rhs).c_str());
                                                                            ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11.hpp:24:0,
                 from ./clock.h:15,
                 from ./locale.h:4,
                 from /usr/include/c++/4.8.2/clocale:42,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/strings.hpp:69:76: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
   return static_cast<r_string>(lhs).operator==(static_cast<std::string>(rhs).c_str());
                                                                            ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h: In function ‘std::pair<const std::basic_string<char>*, const std::basic_string<char>*> fill_weekday_names(const strings&, const strings&, std::string (&)[14])’:
./locale.h:18:20: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
     weekday_names[i] = std::string{CHAR(string)};
                    ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h:18:48: error: too many initializers for ‘std::string {aka std::basic_string<char>}’
     weekday_names[i] = std::string{CHAR(string)};
                                                ^
./locale.h:18:48: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h:22:24: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
     weekday_names[i + 7] = std::string{CHAR(string)};
                        ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h:22:52: error: too many initializers for ‘std::string {aka std::basic_string<char>}’
     weekday_names[i + 7] = std::string{CHAR(string)};
                                                    ^
./locale.h:22:52: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h:24:74: error: invalid application of ‘sizeof’ to incomplete type ‘std::string [14] {aka std::basic_string<char> [14]}’
   return std::make_pair(weekday_names, weekday_names+sizeof(weekday_names)/sizeof(weekday_names[0]));
                                                                          ^
./locale.h:24:98: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
   return std::make_pair(weekday_names, weekday_names+sizeof(weekday_names)/sizeof(weekday_names[0]));
                                                                                                  ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h: In function ‘std::pair<const std::basic_string<char>*, const std::basic_string<char>*> fill_month_names(const strings&, const strings&, std::string (&)[24])’:
./locale.h:35:18: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
     month_names[i] = std::string{CHAR(string)};
                  ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h:35:46: error: too many initializers for ‘std::string {aka std::basic_string<char>}’
     month_names[i] = std::string{CHAR(string)};
                                              ^
./locale.h:35:46: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h:39:23: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
     month_names[i + 12] = std::string{CHAR(string)};
                       ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h:39:51: error: too many initializers for ‘std::string {aka std::basic_string<char>}’
     month_names[i + 12] = std::string{CHAR(string)};
                                                   ^
./locale.h:39:51: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h:41:68: error: invalid application of ‘sizeof’ to incomplete type ‘std::string [24] {aka std::basic_string<char> [24]}’
   return std::make_pair(month_names, month_names+sizeof(month_names)/sizeof(month_names[0]));
                                                                    ^
./locale.h:41:90: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
   return std::make_pair(month_names, month_names+sizeof(month_names)/sizeof(month_names[0]));
                                                                                          ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h: In function ‘std::pair<const std::basic_string<char>*, const std::basic_string<char>*> fill_ampm_names(const strings&, std::string (&)[2])’:
./locale.h:50:17: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
     ampm_names[i] = std::string{CHAR(string)};
                 ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h:50:45: error: too many initializers for ‘std::string {aka std::basic_string<char>}’
     ampm_names[i] = std::string{CHAR(string)};
                                             ^
./locale.h:50:45: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/clocale:42:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
./locale.h:52:65: error: invalid application of ‘sizeof’ to incomplete type ‘std::string [2] {aka std::basic_string<char> [2]}’
   return std::make_pair(ampm_names, ampm_names+sizeof(ampm_names)/sizeof(ampm_names[0]));
                                                                 ^
./locale.h:52:86: error: invalid use of incomplete type ‘std::string {aka class std::basic_string<char>}’
   return std::make_pair(ampm_names, ampm_names+sizeof(ampm_names)/sizeof(ampm_names[0]));
                                                                                      ^
In file included from /usr/include/c++/4.8.2/string:39:0,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/bits/stringfwd.h:57:11: error: declaration of ‘std::string {aka class std::basic_string<char>}’
     class basic_string;
           ^
In file included from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:41:0,
                 from /usr/include/c++/4.8.2/bits/localefwd.h:40,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/clocale: At global scope:
/usr/include/c++/4.8.2/clocale:53:11: error: ‘::lconv’ has not been declared
   using ::lconv;
           ^
/usr/include/c++/4.8.2/clocale:54:11: error: ‘::setlocale’ has not been declared
   using ::setlocale;
           ^
/usr/include/c++/4.8.2/clocale:55:11: error: ‘::localeconv’ has not been declared
   using ::localeconv;
           ^
In file included from /usr/include/c++/4.8.2/bits/localefwd.h:40:0,
                 from /usr/include/c++/4.8.2/string:43,
                 from /home/dchiu/R/x86_64-pc-linux-gnu-library/4.2/cpp11/include/cpp11/declarations.hpp:4,
                 from cpp11.cpp:5:
/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:52:23: error: ‘uselocale’ was not declared in this scope
   extern "C" __typeof(uselocale) __uselocale;
                       ^
/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:52:45: error: invalid type in declaration before ‘;’ token
   extern "C" __typeof(uselocale) __uselocale;
                                             ^
/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h: In function ‘int std::__convert_from_v(__locale_struct* const&, char*, int, const char*, ...)’:
/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:75:53: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
     __c_locale __old = __gnu_cxx::__uselocale(__cloc);
                                                     ^
/usr/include/c++/4.8.2/x86_64-redhat-linux/bits/c++locale.h:100:33: error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
     __gnu_cxx::__uselocale(__old);

Could I please get some assistance on how to fix this? I think separate from #234 and I've been playing around with .R/Makevars to no avail:

CXX=/usr/bin/g++ -std=gnu++11
CXX11=/usr/bin/g++ -std=gnu++11

g++ version:

g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@DavisVaughan
Copy link
Member

It seems strange that your listed gcc version at the bottom is 4.8.5, but in the compilation output it shows 4.8.2

What does this give you?

/usr/bin/g++ -v 

@DavisVaughan
Copy link
Member

Also I think it would be helpful if you provided the full install log, not just the compilation bits, in case we are missing something

@msquantori
Copy link

I think we have similar issue.

We're running on CentOS 7.9, R version 4.2.0. Initial error seem to be here: /usr/prog/software/GCCcore/11.2.0/include/c++/11.2.0/bits/locale_classes.h:335:37: error: '_GLIBCXX_NUM_CATEGORIES' was not declared in this scope

$> g++ --version
g++ (GCC) 11.2.0

Log file attached.

clock.log

@DavisVaughan
Copy link
Member

Oh that log was very helpful. I think your CentOS compiler is including my local locale.h file instead of the system locale.h file. That seems rather broken on the CentOS side, but it might be an easy fix on my side, I can probably just rename the file

https://stackoverflow.com/questions/32393098/cannot-compile-project-error-in-locale-h-file

@msquantori
Copy link

Thank you for looking into!

@dchiu911
Copy link
Author

dchiu911 commented Dec 1, 2022

Hi @DavisVaughan, the full install log was over the character limit allowed for github issues so I just showed the last parts. Here's my g++:

[dchiu@gphost08 ~]$ /usr/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)

@dchiu911
Copy link
Author

Hello @DavisVaughan any updates on this issue? I updated my g++ to v9.5.0 and still get the same error regarding the locale file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants