Arduino icon indicating copy to clipboard operation
Arduino copied to clipboard

Indexing error when using Eclipse Arduino plugin

Open miky2k opened this issue 11 years ago • 13 comments

eclipse give this error ../.ino.cpp:7:25: fatal error: ESP8266WiFi.h: No such file or directory

But all header file are not recognized (only Arduino.h).

I'm using eclipse 4.5 under ubuntu , arduino 1.6.4 compile sketch correctly. But not advanced web server. notfountesp

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

miky2k avatar Jul 09 '15 08:07 miky2k

have you load the ESP8266WiFi libary?

image

image

Links2004 avatar Jul 09 '15 15:07 Links2004

Ok it works , not so user friendly but wokrs.

Now remain a : Function 'snprintf' could not be resolved WebServices.ino /WebServices line 74

But i can use String object if i not found what it ask for

miky2k avatar Jul 14 '15 14:07 miky2k

you need to include "stdio.h"

Links2004 avatar Jul 14 '15 20:07 Links2004

No , i have stdio.h , and semms only interface trouble i can compile and upload binary. eclipse-snprintf

miky2k avatar Jul 15 '15 06:07 miky2k

ok, you need do the include like:

extern "C" {
#include <stdio.h>
}

the snprintf is implemented in C not in CPP, you need to tell the compiler this or the function is not found. https://github.com/esp8266/Arduino/blob/60efe5caed7b8d14636ae5bcc98a1052b55832b1/hardware/esp8266com/esp8266/cores/esp8266/libc_replacements.c#L77

Links2004 avatar Jul 15 '15 08:07 Links2004

I think stdio.h is smart enough to include #ifdef __cplusplus extern "C" { #endif guards, so that shouldn't be an issue.

Posting the full compiler output would certainly be helpful here.

On Wed, Jul 15, 2015 at 11:13 AM, Markus [email protected] wrote:

ok, you need do the include like:

extern "C" { #include <stdio.h> }

the snprintf is implemented in C not in CPP, you need to tell the compiler this or the function is not found.

https://github.com/esp8266/Arduino/blob/60efe5caed7b8d14636ae5bcc98a1052b55832b1/hardware/esp8266com/esp8266/cores/esp8266/libc_replacements.c#L77

— Reply to this email directly or view it on GitHub https://github.com/esp8266/Arduino/issues/525#issuecomment-121525431.

igrr avatar Jul 15 '15 09:07 igrr

It's not compilation issue , only eclipse interface say that snprintf could not be resolved.

miky2k avatar Jul 15 '15 09:07 miky2k

now i get you problem, you mean this: image I simply ignore it at the moment, its a problem of the eclipse source indexing.

Links2004 avatar Jul 15 '15 10:07 Links2004

Arduino IDE is a fireworks and eclipse is the zar bomb (nuke bomb) for seriously programming , i will investigate about indexing , if you have a hint you are welcome.

miky2k avatar Jul 15 '15 11:07 miky2k

I like your compere :+1: i think the problem comes from the many ifdef inside the stdio.h, based on where the indexer is started may some defines are not set and then the indexing ignore the snprintf be course its "ifdef out".

Links2004 avatar Jul 15 '15 11:07 Links2004

Has this issue been resolved? I'm having the same problem with the eclipse sloeber plugin.

Compiling a sample from pubsubclient library - mqtt_esp8266.ino:

snprintf (msg, 75, "hello world #%ld", value);

is not a sample problem; in the arduino ide this error does not occur.

Modifying to:

     sprintf (msg, "hello world #% ld", value);

The error no longer occurs.

odilonafonso avatar Feb 26 '17 12:02 odilonafonso

@far5893 @Links2004 this issue is ancient. Is it still valid?

devyte avatar Oct 20 '17 05:10 devyte

Closing due to lack of feedback.

devyte avatar Feb 28 '18 13:02 devyte