Skip to content

Compile Error #include expects "FILENAME" or <FILENAME> #1142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nexus1212 opened this issue Feb 8, 2020 · 6 comments
Closed

Compile Error #include expects "FILENAME" or <FILENAME> #1142

Nexus1212 opened this issue Feb 8, 2020 · 6 comments

Comments

@Nexus1212
Copy link

Nexus1212 commented Feb 8, 2020

There is a Bug in the compiling of the MD5.h files.
Path:
C:\Sloeber\arduinoPlugin\packages\esp32\hardware\esp32\1.0.4\tools\sdk\include\mbedtls\mbedtls

see issue:

  1. Include md5.h throws compile error #include expects "FILENAME" or <FILENAME> espressif/arduino-esp32#1327
  2. quoted strings from the command line not always working #1028

If I changed the MD5.h:
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif

to:
#if !defined(MBEDTLS_CONFIG_FILE)
#include "config.h"
#880
#define VAL(str) #str
#define TOSTRING(str) VAL(str)
#include TOSTRING(MBEDTLS_CONFIG_FILE)
#endif

it works! Do you know a better solution?

@jantje
Copy link
Member

jantje commented Feb 8, 2020

Do you know a better solution?

From my point of view the workaround is the way it should be done.

@jantje jantje closed this as completed Feb 8, 2020
@madhephaestus
Copy link
Contributor

madhephaestus commented Jul 12, 2020

PR of this workaround can be found here: espressif/arduino-esp32#4159

The workaround includes a check to see if it is being compiled by eclipse, and does the workaround, and if not to use the normal mode. This check is needed to be sure that the original Arduino IDE works with the same toolchain without a new bug caused by the workaround.

The above OP workaround causes this bug in Arduino IDE:

In file included from 
Arduino/hardware/espressif/esp32/libraries/WebServer/src/WebServer.cpp:32:0:
Arduino/hardware/espressif/esp32/tools/sdk/include/mbedtls/mbedtls/md5.h:38:55: fatal error: \"mbedtls/esp_config.h\": No such file or directory
compilation terminated.

The PR adds checks to prevent this bug.

@jantje
Copy link
Member

jantje commented Jul 12, 2020

As far as I know this is fixed in the latest Sloeber and no workaround is needed

@PappyZero
Copy link

#include SPI.h>
#include <Wire.h>
#include <ESP8266WiFi.h>
#include <SoftwareSerial.h>
#include <ESP8266WebServer.h>
#include <ESP8266HTTPClient.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_Fingerprint.h>

Please this is the code that I giving me an error.

And here are the error messages:

C:\Users\DELL\AppData\Local\Temp.arduinoIDE-unsaved202357-2320-1fc3or9.1k34\sketch_jun7a\sketch_jun7a.ino:23:10: error: #include expects "FILENAME" or
23 | #include SPI.h>
| ^~~
C:\Users\DELL\AppData\Local\Temp.arduinoIDE-unsaved202357-2320-1fc3or9.1k34\sketch_jun7a\sketch_jun7a.ino:24:10: error: #include expects "FILENAME" or
24 | #include <Wire.h>
| ^
C:\Users\DELL\AppData\Local\Temp.arduinoIDE-unsaved202357-2320-1fc3or9.1k34\sketch_jun7a\sketch_jun7a.ino:25:10: error: #include expects "FILENAME" or
25 | #include <ESP8266WiFi.h> // If you face any problem with this library vist here:
| ^
C:\Users\DELL\AppData\Local\Temp.arduinoIDE-unsaved202357-2320-1fc3or9.1k34\sketch_jun7a\sketch_jun7a.ino:26:10: error: #include expects "FILENAME" or
26 | #include <SoftwareSerial.h> // https://youtu.be/oq3_xy2rCyk
| ^
C:\Users\DELL\AppData\Local\Temp.arduinoIDE-unsaved202357-2320-1fc3or9.1k34\sketch_jun7a\sketch_jun7a.ino:27:10: error: #include expects "FILENAME" or
27 | #include <ESP8266WebServer.h>
| ^
C:\Users\DELL\AppData\Local\Temp.arduinoIDE-unsaved202357-2320-1fc3or9.1k34\sketch_jun7a\sketch_jun7a.ino:28:10: error: #include expects "FILENAME" or
28 | #include <ESP8266HTTPClient.h>
| ^
C:\Users\DELL\AppData\Local\Temp.arduinoIDE-unsaved202357-2320-1fc3or9.1k34\sketch_jun7a\sketch_jun7a.ino:29:10: error: #include expects "FILENAME" or
29 | #include <Adafruit_GFX.h> //Library link:https://github.com/adafruit/Adafruit-GFX-Library
| ^
C:\Users\DELL\AppData\Local\Temp.arduinoIDE-unsaved202357-2320-1fc3or9.1k34\sketch_jun7a\sketch_jun7a.ino:30:10: error: #include expects "FILENAME" or
30 | #include <Adafruit_SSD1306.h> //Library link:https://github.com/adafruit/Adafruit_SSD1306
| ^
C:\Users\DELL\AppData\Local\Temp.arduinoIDE-unsaved202357-2320-1fc3or9.1k34\sketch_jun7a\sketch_jun7a.ino:31:10: error: #include expects "FILENAME" or
31 | #include <Adafruit_Fingerprint.h> //Library link:https://github.com/adafruit/Adafruit-Fingerprint-Sensor-Library
| ^

exit status 1

Compilation error: #include expects "FILENAME" or

@jantje
Copy link
Member

jantje commented Jun 8, 2023

#include SPI.h>
Is not correctly formatted code
#include <SPI.h>

@amanbindra1979
Copy link

amanbindra1979 commented Oct 3, 2023

Combination of single quotes, double quotes and / should work:
make CFLAGS='-DMBEDTLS_CONFIG_FILE=\"mbedtls_config.h\"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants