Sysprogs forums › Forums › VisualGDB › c++ 11 and 14 standard library issues in version 5.2b2
- This topic has 3 replies, 2 voices, and was last updated 9 years ago by
support.
-
AuthorPosts
-
October 4, 2016 at 18:31 #9200
borbmizzet
ParticipantI 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.
October 5, 2016 at 03:40 #9202support
KeymasterHi,
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.
October 5, 2016 at 16:00 #9207borbmizzet
ParticipantYes, 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 9 years ago by
borbmizzet.
-
This reply was modified 9 years ago by
borbmizzet.
-
This reply was modified 9 years ago by
borbmizzet.
October 6, 2016 at 01:45 #9218support
KeymasterHi,
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(…)).
-
This reply was modified 9 years ago by
-
AuthorPosts
- You must be logged in to reply to this topic.