c++ 11 and 14 standard library issues in version 5.2b2

Sysprogs forums Forums VisualGDB c++ 11 and 14 standard library issues in version 5.2b2

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9200
    borbmizzet
    Participant

    I have a visualgdb  embedded stand-alone project made with v5.2b2 using msbuild, and in the project properties (not the visualgdb ones)  I have selected the options for -std=c11 and -std=c++14. in ConfigurationProperties->C/C++->Advanced->Language Standard.  However, when I try to build, It still cannot find c++11 functions in the std namespace like std::snprintf() or std::nanf().  I have verified that I have included <cstdio> and <cmath> respectively, and the clang intellisense seems to be having the same issue, even when I add -std=c++14 and -std=c11 to the VisualGDB->Clang Intellisense settings.  I have tried with LDFLAGS “–specs=nano.specs -u _printf_float -u _scanf_float –specs=nosys.specs” and the default + “–specs=nosys.specs”.  Also, there is no spot for CXXFLAGS or CPPFLAGS in the embedded project settings for a stand-alone embedded msbuild project.

    #9202
    support
    Keymaster

    Hi,

    Are you using a toolchain shipped with VisualGDB? If not, your toolchain may be too old and have no support for these functions.

    If yes, please double-check that the <source file name>.gcc.rsp file in the VisualGDB\<configuration> directory contains the -std setting you have selected. If not, please double-check that you have selected it for the correct project configuration.

    #9207
    borbmizzet
    Participant

    Yes, I am using latest version of the default ARM toolchain (arm-eabi-none) that shipped with VisualGDB.  The .rsp files are also do contain -std=c++11, but not -std=c99 or -std=c11.  It was from a c++ file so I’m assuming that’s normal?  I noticed that _GLIBCXX_USE_C99_MATH_TR1 and _GLIBCXX_USE_C99 are not defined in C:/SysGCC/arm-eabi/arm-eabi/include/c++/5.3.0/arm-eabi/thumb\bits/c++config.h, yet they are required to be defined for certain c++11 functions, such as the ones listed in the above post (see <cmath> and <cstdio>).  Does this mean that the default toolchain is incomplete or improperly configured?

    • This reply was modified 7 years, 6 months ago by borbmizzet.
    • This reply was modified 7 years, 6 months ago by borbmizzet.
    • This reply was modified 7 years, 6 months ago by borbmizzet.
    #9218
    support
    Keymaster

    Hi,

    Sorry, checked the std::printf() instead of std::snprintf(). Yes, our toolchain indeed does not have _GLIBCXX_USE_C99 and  _GLIBCXX_USE_C99_MATH_TR1 enabled (which is the default configuration for GCC), so those functions are not available under the std:: namespace.

    You should be still able to use them via the regular C syntax (e.g. snprintf(…) or nanf(…)).

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.