"leonardomt via Lists.Zephyrproject.Org"
I am failing to create a Zephyr project for Eclipse with C++ support.
Is there a working example or guide I can use as reference to set this up?
My end goal is to use Zephyr + nRF SDK in C++ with debugging in any IDE, preferably SEGGER or Eclipse.
After importing project "hello_world", Eclipse underlines function "printk" in red:
==> Function 'printk' could not be resolved <==
==> Symbol 'CONFIG_BOARD' could not be resolved <==
Here's the steps I follow to setup the project:
Eclipse 4.12 + GNU MCU 4.5.1
Edit prj.conf and .config:
I copied these into samples/hello_world/prj.conf, but:
west build -b nrf52840_pca10056
C:/embedded/zephyrproject/zephyr/samples/hello_world -- -G"Eclipse
CDT4 - Ninja" -D_ECLIPSE_VERSION=4.12
I can't reproduce this on my Arch Linux machine with
ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb, toolchain version
The build finishes successfully for me, and works when I flash it to my
What toolchain are you using? Can you try with gnuarmemb?https://docs.zephyrproject.org/latest/getting_started/toolchain_3rd_party_x_compilers.html#gnu-arm-embedded
[18/98] Building CXX object CMakeFiles/app.dir/src/main.cpp.obj
cc1plus.exe: warning: command line option '-Wno-pointer-sign' is valid for C/ObjC but not for C++
Import project into Eclipse
Error in main.cpp:
Function 'printk' could not be resolved
set (CMAKE_CXX_STANDARD 11) in CMakeLists.txt
Manually add "__cplusplus=201402L" as a symbol in Eclipse (cmake does not generate such symbol in .cproject)
Force boilerplate.cmake to call eclipse_cdt4_generator_amendment with
work mode = 2 (.cproject with __cplusplus)
BTW, since you mentioned Segger and you're using nRF:https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/gs_programming.html#building-with-ses