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


Bolivar, Marti
 

"leonardomt via Lists.Zephyrproject.Org"
<leonardomt=gmail.com@lists.zephyrproject.org> writes:

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?
No, sorry, I just built it on the command line.


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!
I'm not an Eclipse user, sorry :(. It does sound like there's something
wrong with the way either linking or symbol resolution is going on in
Eclipse, though.

Sorry I couldn't be more help. I thought you were seeing this issue on
the command line.

Marti


Thanks!
Leo

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