Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Could not be resolved error in Eclipse CDT

📅 2014-Nov-07 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

Problem

I had some C++ code in Eclipse CDT. It was indicating that some lines of code had error like this:

function to_string could not be resolved

Method length could not be resolved

This code compiles correctly without any error or warning. I was just looking for a way to make this spurious error highlighting in Eclipse go away.

Solution

These errors are shown by the Indexer in Eclipse. It may not be able to resolve symbols because these symbols are not visible to it. This can happen for example if:

My above errors went away when I solved them like this:

Tried with: Eclipse Luna 4.4.1, GCC 4.9.2 and Ubuntu 14.04