Re: C++ support (Eclipse CDT4) - 'printk' could not be resolved #west


Leo
 

Hi and thanks for your prompt response!

I tried both toolchains, gnuarmemb and zephyr.

I can successfully load a zephyr project *without cpp support* into Segger (as in the link) or Eclipse and compile, flash and debug just fine.
Also, you are right in that everything works as expected when using the command line, no matter if the project is c or cpp.

The issue only occurs when you use Eclipse to import a project that requires cpp support:
Eclipse wont recognize some functions (such as printk) and some symbols, instead it will highlight them as if they were not declared anywhere.

Just to make sure I understood correctly, you successfully built the project (the cpp version; main.c --> main.cpp), but did you import it into Eclipse and got no errors after indexing finished?

I read that Eclipse has two separate tools for indexing and resolving symbols/function so I wonder if this error has anything to do with the configuration in Eclipse as opposed to the cmake generator. Another likely situation is that I am not setting things right... either way, help is appreciated!

Thanks!
Leo






Join users@lists.zephyrproject.org to automatically receive all group messages.