Monday, December 11th 2017, 10:23am UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

bootchk

Beginner

Date of registration: Oct 14th 2016

Posts: 6

1

Thursday, November 30th 2017, 12:12pm

C++ errors in NRF file that compiles cleanly with other IDE's

Error :

../../../../../../components/libraries/util/app_util.h:118:55: error: expected constructor, destructor, or type conversion before ‘(’ token

in this source (written by Nordic):

#ifdef __GNUC__
#define STATIC_ASSERT_SIMPLE(EXPR) _Static_assert(EXPR, "unspecified message")

included from a .cpp file.

I am porting a project from Eclipse, where this compiles cleanly with C++ using the GNU ARM tools. AFAIK this is valid code, so I suspect my project options or the generated compiler command is not correct.

I have tried changing Project>Options>Compiler><foo> Language Standard to various values including GNU++14 etc.

How do you view the exact compiler command in the transcript?

bootchk

Beginner

Date of registration: Oct 14th 2016

Posts: 6

2

Thursday, November 30th 2017, 1:23pm

More info: _Static_assert should be a compiler keyword since C11. I think the compiler is not recognizing it as a keyword.

Does SES install its own versions of the GCC ARM toolchain? Maybe my other IDE is using a different compiler ((different version?)

SEGGER - Nino

Super Moderator

Date of registration: Jan 2nd 2017

Posts: 434

3

Thursday, November 30th 2017, 2:29pm

Hello,

Thank you for your inquiry.

_Static_assert is only a keyword in C.
For C++ use static_assert.

Quoted

Does SES install its own versions of the GCC ARM toolchain? Maybe my other IDE is using a different compiler ((different version?)

Quite possible that different versions are used. To find out which one ES is using go to Help->About SEGGER Embedded Studio

Best regards,
Nino