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

sdk_resources.h does not build with GCC

Hi, I'm trying to move from nRF5_SDK_11.0.0_89a8197 to nRF5_SDK_12.0.0_12f24da and faced an issue. I have build error in

....../nRF5_SDK_12.0.0_12f24da/components/libraries/util/sdk_resources.h:56:1: error: expected declaration before '}' token } ^

It looks like sdk_resources.h have some conditional declarations starting at line 37

#ifdef ESB_PRESENT
    #include "nrf_esb_resources.h"

#ifdef __cplusplus // <--- it looks like this should be outside of #ifdef ESB_PRESENT 
extern "C" {
#endif
#else
    #define ESB_PPI_CHANNELS_USED    0uL /**< PPI channels utilized by ESB (not available to th spplication). */
    #define ESB_TIMERS_USED          0uL /**< Timers used by ESB. */
    #define ESB_SWI_USED             0uL /**< Software interrupts used by ESB */
#endif

#define NRF_PPI_CHANNELS_USED (SD_PPI_CHANNELS_USED | GZLL_PPI_CHANNELS_USED | ESB_PPI_CHANNELS_USED)
#define NRF_PPI_GROUPS_USED   (SD_PPI_GROUPS_USED)
#define NRF_SWI_USED          (SD_SWI_USED | GZLL_SWI_USED | ESB_SWI_USED)
#define NRF_TIMERS_USED       (SD_TIMERS_USED | GZLL_TIMERS_USED | ESB_TIMERS_USED)


#ifdef __cplusplus
}
#endif

Does anyone know how to workaround this without modifying SDK sources? Thanks

Using GCC

>g++ -v

Using built-in specs. COLLECT_GCC=C:\Programs\MinGW\bin\g++.exe COLLECT_LTO_WRAPPER=c:/programs/mingw/bin/../libexec/gcc/mingw32/4.9.3/lto-wrapper.exe Target: mingw32 Configured with: ../src/gcc-4.9.3/configure --build=x86_64-pc-linux-gnu --host=mingw32 --prefix=/mingw --disable-win32-registry --target=mingw32 --wi th-arch=i586 --enable-languages=c,c++,objc,obj-c++,fortran,ada --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptio ns --enable-version-specific-runtime-libs --enable-libstdcxx-debug --with-tune=generic --enable-nls Thread model: win32 gcc version 4.9.3 (GCC)

Related