Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

false error from Eclipse: Function '__android_log_print' could not be resolved (Android, CDT)

I have an Android NDK project whose NDK part compiles ok from command line; I used to have no problems with running the compiled stuff from under Eclipse as a pure Java project. But I converted it to a C/C++ project and now cannot even run it.

I see in the "Console" that the library is built, BUT: Eclipse tells me that my project has errors and it will not run it. (Why on Earth? The code is compiled!!!)

I have resolved some issues with missing symbols by adding include paths to the project properties.

But I'm still getting this weird Function '__android_log_print' could not be resolved error.

So, two questions:

  1. How do I get rid of this error? (Can it be ignored?)
  2. Plan B: how do I convert this mixed C/C++/Java project to a pure Java one?

= = =

PS "As you call the ship, so it will do". Could not they just find a better name for an IDE, something like "Lucid coding"? (Rhetoric question)

= = =

UPDATE: It looks like Eclipse reports errors only for the files that it sees (that is, shows you). I have opened another file with a LOGD macro, and the Eclipse reported an error for it too. I have closed all file windows, closed Eclipse and deleted a .something file. After that, I was able to run the application. I did not risk to open the source files with that logging macro. (That's very far from "Lucid coding", isn't it?)

like image 321
18446744073709551615 Avatar asked Feb 13 '12 09:02

18446744073709551615


1 Answers

The configuration of CDT indexer needs to enable "Index unused headers ..."

How to get there: Project->Properties->C/C++ General->Indexer.

enter image description here

Gets rid of the error for me.

like image 155
Tom Phan Avatar answered Sep 17 '22 17:09

Tom Phan