This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SES Compiling Blinky with GNU++11

Hi,

I'm trying to include a library written in C++ which requires at least GNU++11. Unfortunately if I switch the C++ compiler in SES I get the following error:

2> In file included from ../nrf_SDK/components/ble/common/ble_srv_common.h:54,
2>                  from /Users/bernerj/Documents/SEGGER Embedded Studio for ARM Projects/ses-food-sensor/Application/main.cpp:54:
2> ../nrf_SDK/components/libraries/util/app_util.h:216:55: error: expected constructor, destructor, or type conversion before '(' token
2> ../nrf_SDK/components/libraries/util/app_util.h:237:62: note: in definition of macro '_SELECT_ASSERT_FUNC'
2> ../nrf_SDK/components/libraries/util/app_util.h:253:25: note: in expansion of macro 'STATIC_ASSERT_MSG'
2> ../nrf_SDK/components/softdevice/common/nrf_sdh_ble.h:83:1: note: in expansion of macro 'STATIC_ASSERT'
2> ../nrf_SDK/components/ble/nrf_ble_gatt/nrf_ble_gatt.h:71:1: note: in expansion of macro 'NRF_SDH_BLE_OBSERVER'
2> /Users/bernerj/Documents/SEGGER Embedded Studio for ARM Projects/ses-food-sensor/Application/main.cpp:92:1: note: in expansion of macro 'NRF_BLE_GATT_DEF'
2> ../nrf_SDK/components/libraries/util/app_util.h:216:55: error: expected constructor, destructor, or type conversion before '(' token
2> ../nrf_SDK/components/libraries/util/app_util.h:237:62: note: in definition of macro '_SELECT_ASSERT_FUNC'
2> ../nrf_SDK/components/libraries/util/app_util.h:253:25: note: in expansion of macro 'STATIC_ASSERT_MSG'
2> ../nrf_SDK/components/softdevice/common/nrf_sdh_ble.h:84:1: note: in expansion of macro 'STATIC_ASSERT'
2> ../nrf_SDK/components/ble/nrf_ble_gatt/nrf_ble_gatt.h:71:1: note: in expansion of macro 'NRF_SDH_BLE_OBSERVER'
2> /Users/bernerj/Documents/SEGGER Embedded Studio for ARM Projects/ses-food-sensor/Application/main.cpp:92:1: note: in expansion of macro 'NRF_BLE_GATT_DEF'
2> ../nrf_SDK/components/libraries/util/app_util.h:216:55: error: expected constructor, destructor, or type conversion before '(' token
2> ../nrf_SDK/components/libraries/util/app_util.h:237:62: note: in definition of macro '_SELECT_ASSERT_FUNC'
2> ../nrf_SDK/components/libraries/util/app_util.h:253:25: note: in expansion of macro 'STATIC_ASSERT_MSG'
2> ../nrf_SDK/components/softdevice/common/nrf_sdh_ble.h:83:1: note: in expansion of macro 'STATIC_ASSERT'
2> ../nrf_SDK/components/ble/nrf_ble_qwr/nrf_ble_qwr.h:74:5: note: in expansion of macro 'NRF_SDH_BLE_OBSERVER'
2> /Users/bernerj/Documents/SEGGER Embedded Studio for ARM Projects/ses-food-sensor/Application/main.cpp:93:1: note: in expansion of macro 'NRF_BLE_QWR_DEF'
2> ../nrf_SDK/components/libraries/util/app_util.h:216:55: error: expected constructor, destructor, or type conversion before '(' token
2> ../nrf_SDK/components/libraries/util/app_util.h:237:62: note: in definition of macro '_SELECT_ASSERT_FUNC'
2> ../nrf_SDK/components/libraries/util/app_util.h:253:25: note: in expansion of macro 'STATIC_ASSERT_MSG'
2> ../nrf_SDK/components/softdevice/common/nrf_sdh_ble.h:84:1: note: in expansion of macro 'STATIC_ASSERT'
2> ../nrf_SDK/components/ble/nrf_ble_qwr/nrf_ble_qwr.h:74:5: note: in expansion of macro 'NRF_SDH_BLE_OBSERVER'

Is there a way to fix this? 

Parents Reply Children
  • SES does not support C++. It stripped out C++ support from GCC.

    Do not mislead people. C ++ support is and is working properly. Here is a brief excerpt from the site:

    Embedded Studio is a powerful C/C++ IDE (Integrated Development Environment)
    for embedded systems. It is specifically designed to provide users with everything 
    needed for professional embedded C programming and development: 
    An all-in-one solution providing stability and a continuous workflow for any
    development environment.
    
    * Professional IDE solution for embedded C/C++ programming
    * Cross-Platform: Runs on Windows, macOS, and Linux
    * Clang/LLVM, and GCC C/C++ Compilers included

    here is the link to the original.

  • Looks like you don't the inner of it.  SES It is a strip down version of CrossWorks.  The compiler installed with it is GCC with most of the C++ header removed.  GCC is a C++ compiler, but without the proper header files, you cannot compile C++ code. This is actually a CrossWorks issue not SES.   However, CrossWorks allows you to setup external full GCC.  Only this option allows you to compile C++.  

  • I'm currently doing a test project using c. STL library is really not complete, but it works.

    As I understand it, std and stl are different for the world of large PCs and for embedded systems. If only because in embedded systems there are much fewer resources. Therefore, porting is not possible directly, only with restrictions.

     The external compiler connects normally and also works successfully. I connected this GNU ARM 9-2020-q2 according to the instructions from  here

    What I do wrong?

Related