Error setlocale was not declared in this scope

Error: 'setlocate' was not declared in this scope C (СИ) Решение и ответ на вопрос 2040696

Korotush

0 / 0 / 0

Регистрация: 17.09.2017

Сообщений: 5

1

17.09.2017, 10:17. Показов 3929. Ответов 3

Метки нет (Все метки)


Нужно написать программу на СИ, я новичок, выдает мне ошибки, что здесь не верно?

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <math.h>
#include <stdio.h>
#include <locale.h>
#define a 2.7
#define b 1.7
int main()
{
  setlocate(LC_ALL, "RUS");
  float x, y;
  printf("введите xn");
  scanf_s("%f", &x);
  y=a*a/((x+2)*exp(-b*x))+log(a+b*x);
  printf("сумма=%fn", y);
  _getche();
}

In function ‘int main()’:
9:26: error: ‘setlocate’ was not declared in this scope
12:19: error: ‘scanf_s’ was not declared in this scope
15:11: error: ‘_getche’ was not declared in this scope

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



MansMI

Заблокирован

17.09.2017, 10:28

2

#include <stdlib.h>

Добавлено через 2 минуты

Цитата
Сообщение от Korotush
Посмотреть сообщение

setlocate

???



0



0 / 0 / 0

Регистрация: 17.09.2017

Сообщений: 5

17.09.2017, 10:34

 [ТС]

3

Это я уже увидела и исправила, просто опечатка



0



zss

Модератор

Эксперт С++

12641 / 10135 / 6102

Регистрация: 18.12.2011

Сообщений: 27,170

17.09.2017, 11:09

4

C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <math.h>
#include <stdio.h>
#include <conio.h>
#include <locale.h>
#define a 2.7
#define b 1.7
int main()
{
  double x,y;
  setlocale(LC_ALL, "RUS");
  printf("введите xn");
  scanf_s("%lf", &x);
  y=a*a/((x+2.0)*exp(-b*x))+log(a+b*x);
  printf("Для x = %lf Значение выражения = %lfn", x, y);
  _getche();
}

При вводе обратите внимание, что целую часть от дробной надо отделять ЗАПЯТОЙ из за настройки на русскую локаль.
И если среда не Visual Studio, то используйте scanf вместо scanf_s



0



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

17.09.2017, 11:09

4

  • Summary

  • Files

  • Reviews

  • Support

  • Forums

  • Donate

Menu

64bit Compiling with MSYS2 locale_t error


Created:

2016-02-21

Updated:

2016-02-25

  • Fred

    Hi,

    I am trying to compile IfcOpenShell on Windows using MSYS2. So far, it’s been fantastic compared to prior experiences with MSYS. OCE compiled without much problem, but now I have an issue with IfcOpenShell. I get the error when compiling IfcParse.cpp. The error is:

    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:62:8: error: ‘locale_t’ does not name a type static locale_t locale = (locale_t) 0;

    It seems that locale_t is not defined. Google is suggesting that locale_t should be defined in <locale.h> but adding #include<locale.h> (or #include<clocale>) does not have an effect (I see that for Apple, the code adds #include<xlocale.h> but nothing otherwise). For _MSC_VER, the code refers _locale_t, instead of locale_t.
    My main issue is where is locale_t supposed to be defined? And then: what #include is missing from the header file?
    Thanks in advance for any idea.

    PS: Once I’ve completed the compilation, I’ll post a guide with the steps I’ve been through to complete it. That could be helpful to new comers.

     

    Last edit: Fred 2016-02-21

  • Stinkfist

    Great to hear! It would be great to also have build scripts for MinGW. locale_t seems to be newish POSIX feature, so it’s not part of the standard (hence e.g. MSVC has it prefixed with underscore). As a quick fix at least (within#ifdef __MINGW__ or similar) typedef void *locale_t could work, as suggested here http://stackoverflow.com/questions/3163870/missing-locale-t

     

    Last edit: Stinkfist 2016-02-22

  • Fred

    Thanks for the quick response. I did come across that webpage and other ones, but my problem (and that’s my mistake, I wasn’t clear enough) is that this is only one of a series of errors that all seem to point towards the missing <locale.h> header (and maybe more).

    The full error report is:

    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:85:8: error: 'locale_t' does not name a type
     static locale_t locale = (locale_t) 0;
            ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp: In function 'void init_locale()':
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:87:6: error: 'locale' was not declared in this scope
      if (locale == (locale_t) 0) {
          ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:87:6: note: suggested alternative:
    In file included from C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:41:0,
                     from C:/msys64/mingw64/include/c++/5.3.0/ios:42,
                     from C:/msys64/mingw64/include/c++/5.3.0/ostream:38,
                     from C:/msys64/mingw64/include/c++/5.3.0/iterator:64,
                     from C:/boost_1_55_0/boost/detail/iterator.hpp:54,
                     from C:/boost_1_55_0/boost/iterator/iterator_traits.hpp:8,
                     from C:/boost_1_55_0/boost/range/mutable_iterator.hpp:25,
                     from C:/boost_1_55_0/boost/range/iterator.hpp:19,
                     from C:/boost_1_55_0/boost/range/begin.hpp:24,
                     from C:/boost_1_55_0/boost/algorithm/string/trim.hpp:16,
                     from C:/boost_1_55_0/boost/algorithm/string.hpp:19,
                     from C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:31:
    C:/msys64/mingw64/include/c++/5.3.0/bits/locale_classes.h:62:9: note:   'std::locale'
       class locale
             ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:87:17: error: 'locale_t' was not declared in this scope
      if (locale == (locale_t) 0) {
                     ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:87:27: error: expected ')' before numeric constant
      if (locale == (locale_t) 0) {
                               ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:88:22: error: 'LC_NUMERIC_MASK' was not declared in this scope
       locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
                          ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:88:55: error: expected ')' before numeric constant
       locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
                                                           ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:88:56: error: 'newlocale' was not declared in this scope
       locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
                                                            ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp: In static member function 'static bool IfcParse::TokenFunc::isFloat(const Token&)':
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:447:38: error: 'locale' was not declared in this scope
      double result = strtod_l(start,&end,locale);
                                          ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:447:38: note: suggested alternative:
    In file included from C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:41:0,
                     from C:/msys64/mingw64/include/c++/5.3.0/ios:42,
                     from C:/msys64/mingw64/include/c++/5.3.0/ostream:38,
                     from C:/msys64/mingw64/include/c++/5.3.0/iterator:64,
                     from C:/boost_1_55_0/boost/detail/iterator.hpp:54,
                     from C:/boost_1_55_0/boost/iterator/iterator_traits.hpp:8,
                     from C:/boost_1_55_0/boost/range/mutable_iterator.hpp:25,
                     from C:/boost_1_55_0/boost/range/iterator.hpp:19,
                     from C:/boost_1_55_0/boost/range/begin.hpp:24,
                     from C:/boost_1_55_0/boost/algorithm/string/trim.hpp:16,
                     from C:/boost_1_55_0/boost/algorithm/string.hpp:19,
                     from C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:31:
    C:/msys64/mingw64/include/c++/5.3.0/bits/locale_classes.h:62:9: note:   'std::locale'
       class locale
             ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:447:44: error: 'strtod_l' was not declared in this scope
      double result = strtod_l(start,&end,locale);
                                                ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp: In static member function 'static double IfcParse::TokenFunc::asFloat(const Token&)':
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:474:38: error: 'locale' was not declared in this scope
      double result = strtod_l(start,&end,locale);
                                          ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:474:38: note: suggested alternative:
    In file included from C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:41:0,
                     from C:/msys64/mingw64/include/c++/5.3.0/ios:42,
                     from C:/msys64/mingw64/include/c++/5.3.0/ostream:38,
                     from C:/msys64/mingw64/include/c++/5.3.0/iterator:64,
                     from C:/boost_1_55_0/boost/detail/iterator.hpp:54,
                     from C:/boost_1_55_0/boost/iterator/iterator_traits.hpp:8,
                     from C:/boost_1_55_0/boost/range/mutable_iterator.hpp:25,
                     from C:/boost_1_55_0/boost/range/iterator.hpp:19,
                     from C:/boost_1_55_0/boost/range/begin.hpp:24,
                     from C:/boost_1_55_0/boost/algorithm/string/trim.hpp:16,
                     from C:/boost_1_55_0/boost/algorithm/string.hpp:19,
                     from C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:31:
    C:/msys64/mingw64/include/c++/5.3.0/bits/locale_classes.h:62:9: note:   'std::locale'
       class locale
             ^
    C:/msys64/IfcOpenShell/src/ifcparse/IfcParse.cpp:474:44: error: 'strtod_l' was not declared in this scope
      double result = strtod_l(start,&end,locale);
                                                ^
    

    As you can see, this is more than just locale_t, but a bunch of other things including the function newlocale() are missing.
    I have a feeling I should post this question on the MSYS2 forum. I’ll report what they say. Any other idea is welcome.

  • Stinkfist

    These errors are in the same vein. The code is not compiled ever with GCC/MinGW on Windows, so in many places it is assumed that when compiling on Windows, MSVC specific functions are used. One just has to sort these out one by one, no other way around it. There might be good pointers in the dependencies (e.g. OCE) that support MinGW.

     

    Last edit: Stinkfist 2016-02-22

  • Thomas Krijnen

    Hi,

    Indeed thanks for trying this. Would be a nice result indeed if IfcOpenShell can be built without difficulties on MinGW.

    C:/msys64/mingw64/include/c++/5.3.0/bits/locale_classes.h:62:9: note:   'std::locale'
       class locale
    

    The above snippet worries me a bit. It’s a bit cryptic, does it imply she chokes on her own header file? Is there perhaps a newer updated MinGW available?

    Secondly, if there is no support for the POSIX locale_t. Then most likely the strtod_l() will not work either. A quick google finds me this [1] snippet that indeed provides some sort of workaround specifically for MinGW.
    [1] http://fossies.org/linux/julia/src/support/strtod.c#l_43

    In C++ the better work-around would probably be to use std::istringstream::imbue(std::locale::classic()) as described in the source [2].
    [2] https://github.com/IfcOpenShell/IfcOpenShell/blob/master/src/ifcparse/IfcParse.cpp#L48

    Proper locale support is not the point anyway, we just need to make sure the «C» locale is set when parsing floating point numbers in some language settings. Would something like below work? I.e. do you have the «locale» (without the .h) header?

    #ifdef __MINGW32__
    #include <locale>
    #include <sstream>
    
    typedef void* locale_t;
    static locale_t locale = (locale_t) 0;
    
    void init_locale() {}
    
    double strtod_l(const char* start, char** end, locale_t loc) {
        double d;
        std::stringstream ss;
        ss.imbue(std::locale::classic());
        ss << start;
        ss >> d;
        size_t nread = ss.tellg();
        *end = const_cast<char*>(start) + nread;
        return d;
    }
    #endif
    

    Hope that helps,

    Kind regards,
    Thomas

    • Fred

      Hi,

      Thanks for this.
      My MSYS2 install is brand new and all packages are (by default) up to date, e.g. GCC v5.3.

      Before going back to your suggestion (thanks so much for this), after having posted my error log, I realised I was using a different version of Boost (v1.55) than the MSYS2 version (v1.60) that I should better use. Unfortunately, this led me to some prior errors before reaching the ones above.
      The new error log is shown below.
      While I look into this, could you at least let me know which version of Boost you use for compiling IfcOpenShell?

      In file included from C:/msys64/mingw64/include/boost/variant.hpp:17:0,
                       from C:/msys64/IfcOpenShell/src/ifcparse/IfcWrite.h:32,
                       from C:/msys64/IfcOpenShell/src/ifcparse/Ifc4-latebound.cpp:34:
      C:/msys64/mingw64/include/boost/variant/variant.hpp: In instantiation of 'boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>::variant() [with T0_ = boost::none_t; T1 = IfcWrite::IfcWriteArgument::Derived; T2 = int; T3 = bool; T4 = double; T5 = std::__cxx11::basic_string<char>; T6 = boost::dynamic_bitset<>; T7 = IfcWrite::IfcWriteArgument::EnumerationReference; T8 = IfcUtil::IfcBaseClass*; T9 = std::vector<int>; T10 = std::vector<double>; T11 = std::vector<std::__cxx11::basic_string<char> >; T12 = std::vector<boost::dynamic_bitset<> >; T13 = boost::shared_ptr<IfcEntityList>; T14 = std::vector<std::vector<int> >; T15 = std::vector<std::vector<double> >; T16 = boost::shared_ptr<IfcEntityListList>; T17 = boost::detail::variant::void_; T18 = boost::detail::variant::void_; T19 = boost::detail::variant::void_]':
      C:/msys64/IfcOpenShell/src/ifcparse/IfcWrite.h:110:52:   required from here
      C:/msys64/mingw64/include/boost/variant/variant.hpp:1370:9: error: no matching function for call to 'boost::none_t::none_t()'
               new( storage_.address() ) internal_T0();
               ^
      In file included from C:/msys64/mingw64/include/boost/none.hpp:16:0,
                       from C:/msys64/mingw64/include/boost/optional/optional.hpp:51,
                       from C:/msys64/mingw64/include/boost/optional.hpp:15,
                       from C:/msys64/IfcOpenShell/src/ifcparse/Ifc4.h:33,
                       from C:/msys64/IfcOpenShell/src/ifcparse/Ifc4-latebound.cpp:31:
      C:/msys64/mingw64/include/boost/none_t.hpp:32:12: note: candidate: boost::none_t::none_t(boost::none_t::init_tag)
         explicit none_t(init_tag){} // to prevent default constructor
                  ^
      C:/msys64/mingw64/include/boost/none_t.hpp:32:12: note:   candidate expects 1 argument, 0 provided
      C:/msys64/mingw64/include/boost/none_t.hpp:29:8: note: candidate: boost::none_t::none_t(const boost::none_t&)
       struct none_t
              ^
      C:/msys64/mingw64/include/boost/none_t.hpp:29:8: note:   candidate expects 1 argument, 0 provided
      CMakeFiles/IfcParse.dir/build.make:62: recipe for target 'CMakeFiles/IfcParse.dir/C_/msys64/IfcOpenShell/src/ifcparse/Ifc4-latebound.cpp.obj' failed
      

       

      Last edit: Fred 2016-02-24

  • Fred

    So, for the BOOST problem above, I simply had to add the following to the CMakeLists.txt file (I put it at the end of the section «Find Boost»):

    ADD_DEFINITIONS(-DBOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE)
    

    I’m now back trying your idea for the initial problem (locale_t).

  • Fred

    Alright,

    So your idea for the locale issue worked. In IfcParse.cpp, I changed the code for creating the static locale to (using your code with « _MINGW64 » instead of « MINGW32 _»):

    #ifdef _MSC_VER
    static _locale_t locale = (_locale_t) 0;
    void init_locale() {
        if (locale == (_locale_t) 0) {
            locale = _create_locale(LC_NUMERIC, "C");
        }
    }
    #endif
    
    #ifdef __APPLE__
    #include <xlocale.h>
    
    static locale_t locale = (locale_t) 0;
    void init_locale() {
        if (locale == (locale_t) 0) {
            locale = newlocale(LC_NUMERIC_MASK, "C", (locale_t) 0);
        }
    }
    #endif
    
    #ifdef __MINGW64__
    #include <locale>
    #include <sstream>
    
    typedef void* locale_t;
    static locale_t locale = (locale_t) 0;
    
    void init_locale() {}
    
    double strtod_l(const char* start, char** end, locale_t loc) {
        double d;
        std::stringstream ss;
        ss.imbue(std::locale::classic());
        ss << start;
        ss >> d;
        size_t nread = ss.tellg();
        *end = const_cast<char*>(start) + nread;
        return d;
    }
    #endif
    

    This enables the successful compilation of IfcParse library!
    Things went well for IfcGeom afterwards, but it failed at IfcConvert because the linker couldn’t find -licudata and -ldl. While I sorted this out by removing «-licudata -ldl» in the two locations where it appears in the corresponding build.make file, I believe the issue would be better sorted in the CMakeLists.txt file that should read something like:

    IF(MSVC OR MINGW)
        SET(ICU_LIBRARIES icuuc icudt)
        ADD_DEBUG_VARIANTS(ICU_LIBRARIES "${ICU_LIBRARIES}" "d")
        ADD_DEFINITIONS(-DU_STATIC_IMPLEMENTATION) # required for static ICU
    ELSE()
        SET(ICU_LIBRARIES icuuc icudata dl)
    ENDIF()
    

    Note that I only added «OR MINGW» in the first line. However, I know nothing about ICU and haven’t actually tested this fix (although I know I’m looking at the right place). Maybe the MINGW case should be separate and slightly different…
    Anyways, my editing of the build.make file above did work.

    Personally, I only need IfcParse and IfcGeom, so I should be good to go. Nonetheless, the full compilation has not completed yet and failed for GeomServer. The error log is:

    C:/msys64/IfcOpenShell/src/ifcgeomserver/IfcGeomServer.cpp: In function 'int main()':
    C:/msys64/IfcOpenShell/src/ifcgeomserver/IfcGeomServer.cpp:299:38: error: no matching function for call to 'std::basic_ostream<char>::setf(const openmode&)'
      std::cout.setf(std::ios_base::binary);
                                          ^
    In file included from C:/msys64/mingw64/include/c++/5.3.0/ios:42:0,
                     from C:/msys64/mingw64/include/c++/5.3.0/ostream:38,
                     from C:/msys64/mingw64/include/c++/5.3.0/iostream:39,
                     from C:/msys64/IfcOpenShell/src/ifcgeomserver/IfcGeomServer.cpp:27:
    C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:646:5: note: candidate: std::ios_base::fmtflags std::ios_base::setf(std::ios_base::fmtflags)
         setf(fmtflags __fmtfl)
         ^
    C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:646:5: note:   no known conversion for argument 1 from 'const openmode {aka const std::_Ios_Openmode}' to 'std::ios_base::fmtflags {aka std::_Ios_Fmtflags}'
    C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:663:5: note: candidate: std::ios_base::fmtflags std::ios_base::setf(std::ios_base::fmtflags, std::ios_base::fmtflags)
         setf(fmtflags __fmtfl, fmtflags __mask)
         ^
    C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:663:5: note:   candidate expects 2 arguments, 1 provided
    C:/msys64/IfcOpenShell/src/ifcgeomserver/IfcGeomServer.cpp:301:37: error: no matching function for call to 'std::basic_istream<char>::setf(const openmode&)'
      std::cin.setf(std::ios_base::binary);
                                         ^
    In file included from C:/msys64/mingw64/include/c++/5.3.0/ios:42:0,
                     from C:/msys64/mingw64/include/c++/5.3.0/ostream:38,
                     from C:/msys64/mingw64/include/c++/5.3.0/iostream:39,
                     from C:/msys64/IfcOpenShell/src/ifcgeomserver/IfcGeomServer.cpp:27:
    C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:646:5: note: candidate: std::ios_base::fmtflags std::ios_base::setf(std::ios_base::fmtflags)
         setf(fmtflags __fmtfl)
         ^
    C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:646:5: note:   no known conversion for argument 1 from 'const openmode {aka const std::_Ios_Openmode}' to 'std::ios_base::fmtflags {aka std::_Ios_Fmtflags}'
    C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:663:5: note: candidate: std::ios_base::fmtflags std::ios_base::setf(std::ios_base::fmtflags, std::ios_base::fmtflags)
         setf(fmtflags __fmtfl, fmtflags __mask)
         ^
    C:/msys64/mingw64/include/c++/5.3.0/bits/ios_base.h:663:5: note:   candidate expects 2 arguments, 1 provided
    

    This seems to be a matter of «const». I’m not sure what should be done exactly. If somebody has an idea, I’m happy to try it out and see if I can complete the entire compilation.
    For now, you nonetheless already deserve a big: Cheers!

     

    Last edit: Fred 2016-02-24

    • Fred

      OK. I went back at it this morning and figured what could be the problem. I think this relates to the definition of SET_BINARY_STREAMS at the beginning of IfcGeomServer.cpp. The condition for defining it is:

      #if defined(_WIN32) && !defined(__CYGWIN__)
      

      Changing «!defined(CYGWIN)» to «defined(CYGWIN)» solves the compilation issue. However, once again, this does not necessarily mean it was the right fix. And I don’t really like the idea of having a «&&» with two OS tests; this seems odd. Alternatively, I have appended «!defined(MINGW64)» to the original condition, which also seemed to work.
      Any opinion?

  • Stinkfist

    I believe that in this case the «&& !defined(CYGWIN)» part could probably be removed as it guards Windows-specific and not MSVC-specific header inclusions.

     

    Last edit: Stinkfist 2016-02-25

  • Stinkfist

  • Fred


Log in to post a comment.

Skip to content



Open


Issue created Oct 10, 2021 by Andrii Verbytskyi@andriishContributor

Locale mechanism for numeric parsing not supported on GCC11

The following attempt to compile LHAPDF 6.4.0 FTBFS @ x86_64-apple-darwin20.5.0 with GCC 11 from homebrew

#!/bin/sh -l
set -x
export CXX=g++-11
export CC=gcc-11
wget  https://www.hepforge.org/archive/lhapdf/LHAPDF-6.4.0.tar.gz
rm -rf LHAPDF-6.4.0
tar zxvf LHAPDF-6.4.0.tar.gz
cd LHAPDF-6.4.0
./configure
make -j 4

fails

user@host ~ % sh do.sh 
+ export CXX=g++-11
+ CXX=g++-11
+ export CC=gcc-11
+ CC=gcc-11
+ wget https://www.hepforge.org/archive/lhapdf/LHAPDF-6.4.0.tar.gz
..........SKIP............
+ cd LHAPDF-6.4.0
+ ./configure
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for sw_vers... sw_vers
checking for style of include used by make... GNU
checking whether to compile using MPI... no
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++-11 accepts -g... yes
checking dependency style of g++-11... gcc3
checking whether g++-11 supports C++11 features by default... yes
checking for gcc... gcc-11
checking whether we are using the GNU C compiler... yes
checking whether gcc-11 accepts -g... yes
checking for gcc-11 option to accept ISO C89... none needed
checking whether gcc-11 understands -c and -o together... yes
checking dependency style of gcc-11... gcc3
checking whether ln -s works... yes
checking build system type... x86_64-apple-darwin20.5.0
checking host system type... x86_64-apple-darwin20.5.0
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc-11... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 786432
checking how to convert x86_64-apple-darwin20.5.0 file names to x86_64-apple-darwin20.5.0 format... func_convert_file_noop
checking how to convert x86_64-apple-darwin20.5.0 file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %sn
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc-11 object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking how to run the C preprocessor... gcc-11 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc-11 supports -fno-rtti -fno-exceptions... no
checking for gcc-11 option to produce PIC... -fno-common -DPIC
checking if gcc-11 PIC flag -fno-common -DPIC works... yes
checking if gcc-11 static flag -static works... no
checking if gcc-11 supports -c -o file.o... yes
checking if gcc-11 supports -c -o file.o... (cached) yes
checking whether the gcc-11 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.5.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++-11 -E
checking for ld used by g++-11... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the g++-11 linker (/usr/bin/ld) supports shared libraries... yes
checking for g++-11 option to produce PIC... -fno-common -DPIC
checking if g++-11 PIC flag -fno-common -DPIC works... yes
checking if g++-11 static flag -static works... no
checking if g++-11 supports -c -o file.o... yes
checking if g++-11 supports -c -o file.o... (cached) yes
checking whether the g++-11 linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin20.5.0 dyld
checking how to hardcode library paths into programs... immediate
configure: Building LHAGLUE Fortran wrappers
configure: Building LHAGLUE C++ wrappers
checking for pdflatex... /Library/TeX/texbin/pdflatex
checking for doxygen... no
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... darwin
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking for Cython >= 0.19... no
checking if the g++-11 compiler accepts the -pedantic flag... yes
checking if the g++-11 compiler accepts the -Wall flag... yes
checking if the g++-11 compiler accepts the -Wno-long-long flag... yes
checking if the g++-11 compiler accepts the -Qunused-arguments flag... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/yamlcpp/Makefile
config.status: creating include/Makefile
config.status: creating include/LHAPDF/Makefile
config.status: creating bin/Makefile
config.status: creating bin/lhapdf-config
config.status: creating examples/Makefile
config.status: creating tests/Makefile
config.status: creating doc/Makefile
config.status: creating doc/Doxyfile
config.status: creating lhapdf.pc
config.status: creating wrappers/Makefile
config.status: creating wrappers/python/Makefile
config.status: creating wrappers/python/setup.py
config.status: creating config/config.h
config.status: creating include/LHAPDF/Version.h
config.status: include/LHAPDF/Version.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

****************************************************************
IMPORTANT INFORMATION ABOUT PDF SETS

LHAPDF no longer bundles PDF set data in the package tarball.
The sets are instead all stored online at
  http://lhapdfsets.web.cern.ch/lhapdfsets/current/
and you should install those that you wish to use into
  /usr/local/share/LHAPDF

The downloadable PDF sets are packaged as tarballs, which
must be expanded to be used. The simplest way to do this is with
the 'lhapdf' script, e.g. to install the CT10nlo PDF set:
  lhapdf install CT10nlo
The same effect can be achieved manually with, e.g.:
  wget http://lhapdfsets.web.cern.ch/lhapdfsets/current/CT10nlo.tar.gz -O- | tar xz -C /usr/local/share/LHAPDF

****************************************************************

+ make -j 4
Making all in src
...... SKIP ....
  CXX      GridPDF.lo
GridPDF.cc:170:7: error: 'locale_t' does not name a type
  170 |       locale_t _locale_set, _locale_prev;
      |       ^~~~~~~~
GridPDF.cc: In member function 'void LHAPDF::{anonymous}::NumParser::_set_locale()':
GridPDF.cc:152:9: error: '_locale_set' was not declared in this scope
  152 |         _locale_set = newlocale(LC_NUMERIC_MASK, "C", NULL);
      |         ^~~~~~~~~~~
GridPDF.cc:152:33: error: 'LC_NUMERIC_MASK' was not declared in this scope; did you mean 'LC_NUMERIC'?
  152 |         _locale_set = newlocale(LC_NUMERIC_MASK, "C", NULL);
      |                                 ^~~~~~~~~~~~~~~
      |                                 LC_NUMERIC
GridPDF.cc:152:23: error: 'newlocale' was not declared in this scope; did you mean 'setlocale'?
  152 |         _locale_set = newlocale(LC_NUMERIC_MASK, "C", NULL);
      |                       ^~~~~~~~~
      |                       setlocale
GridPDF.cc:153:9: error: '_locale_prev' was not declared in this scope
  153 |         _locale_prev = uselocale(_locale_set);
      |         ^~~~~~~~~~~~
GridPDF.cc:153:24: error: 'uselocale' was not declared in this scope; did you mean 'setlocale'?
  153 |         _locale_prev = uselocale(_locale_set);
      |                        ^~~~~~~~~
      |                        setlocale
GridPDF.cc: In member function 'void LHAPDF::{anonymous}::NumParser::_reset_locale()':
GridPDF.cc:160:24: error: '_locale_prev' was not declared in this scope
  160 |         if (!uselocale(_locale_prev)) {
      |                        ^~~~~~~~~~~~
GridPDF.cc:160:14: error: 'uselocale' was not declared in this scope; did you mean 'setlocale'?
  160 |         if (!uselocale(_locale_prev)) {
      |              ^~~~~~~~~
      |              setlocale
GridPDF.cc:163:20: error: '_locale_set' was not declared in this scope
  163 |         freelocale(_locale_set);
      |                    ^~~~~~~~~~~
GridPDF.cc:163:9: error: 'freelocale' was not declared in this scope; did you mean 'setlocale'?
  163 |         freelocale(_locale_set);
      |         ^~~~~~~~~~
      |         setlocale
make[2]: *** [GridPDF.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

It seems that sometimes one needs extra headers to be included for locale_t.

g++-11 —version reports

g++-11 (Homebrew GCC 11.2.0) 11.2.0
Copyright (C) 2021 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.

Best regards,

Andrii

Edited Nov 02, 2021 by Andy Buckley

Понравилась статья? Поделить с друзьями:
  • Error setconsolecp was not declared in this scope
  • Error set user settings to driver failed windows 10 как исправить
  • Error session line number was not unique in database history logging moved to new session
  • Error session credential conflict
  • Error servicemain invalid session ammyy