snprintf not a member of std in c++locale.h

2012-06-15
2012-09-26
  • Paul Dufresne

    Paul Dufresne - 2012-06-15

    Well, I am not too good at C and C++.
    Here I am trying to compile a console program written in C++, and after having
    created a project file that does seems to have the correct include
    directories, I now get a last bug that seems internal to Dev-C++.
    Googling 'snprintf not a member of std' seems to show that the problems would
    exist from about 2006.

    Anyway, I am using a beta version: Dev-C++ 4.9.9.2 on Windows XP.
    68 C:\Dev-Cpp\include\c++\3.4.2\mingw32\bits\c++locale.h snprintf' is not a member ofstd'

    Should probably mention that I do have a locally, manually installed MinGW
    somewhere else on the box.

     
  • Paul Dufresne

    Paul Dufresne - 2012-06-15

    People on the net seems to suggest that the solution is to uncheck the
    recursive include checkbox.
    I do not find this checkbox.

    For now my workaround was to comment out:
    In c++locale.h:
    //#ifdef _GLIBCXX_USE_C99
    // const int ret = std::snprintf(out, size, fmt, prec, v);
    //#else
    const int ret = std::sprintf(out, fmt, prec, v);
    //#endif
    std::setlocale(LC_ALL,
    sav);

    And in cstdio:

    if !_GLIBCXX_USE_C99_DYNAMIC

    //using ::snprintf;
    using ::vfscanf;

    and later in the same file:
    namespace std
    {
    //using gnu_cxx::snprintf;
    using
    gnu_cxx::vfscanf;

    Now compilation seems to go a bit farther.

     
  • Paul Dufresne

    Paul Dufresne - 2012-06-15

    hum hum Well, now that I read http://en.wikipedia.org/wiki/Xcode I realize that these people having this bug were on a Mac IDE called Xcode. And that's where the 'recursive include' checkbox must be.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks