-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
ARDUINO_VARIANT cannot be cast to (char*) when compiling in Eclipse/windows #2193
Comments
Guess this should be solved as described here: |
This is more likely an issue with how you are compiling in Eclipse. In Arduino IDE (https://github.com/espressif/arduino-esp32/blob/master/platform.txt#L68) and PIO (https://github.com/espressif/arduino-esp32/blob/master/tools/platformio-build.py#L94) it is passed in as a quoted string. So, how are you building in Eclipse? |
Using Eclipse plugin from Sloeber, The following definition of ARDUINO_VARIANT is used:
I'm guessing that Eclipse / windows is loosing the double quotes somewhere |
Can you add something about eclipse env quoting to the issue title so the next person finds this? |
@Bascy the difference is how the quotes are declared, can you try:
The same issue could also likely be seen with ARUDINO_BOARD as well if you dig into it further. |
Yes this also solves the problem for me, but as i understand it the problem only occurs when compiling on Eclipse and/or Windows OS. |
As mentioned on your other issue, I think these are issues you should be opening against Eclipse Sloeber and not arduino-esp32. The PR you opened may be a solution for this issue BUT there will likely be many more issues as you continue adventuring down the path of an IDE that isn't very well documented or used extensively. |
I've been using this IDE for over a year now with different boards and havent had this problem before. I'm guessing this is the only place in the arduino-esp32 core or any other cores that i've been using that casts the result of a macro expansion of a commandline -D define into a (char*) |
I used to use Eclipse Sloeber but got fed up with lack of support and moved over to Platform IO which is considerably faster and more stable for me. But for this issue, I suspect this is just the first of a few areas that use these defines. Did you create the makefile you are building with or was it generated by Sloeber? If it was done by Sloeber you should probably open an issue against it so they can ensure this gets passed in correctly for any other constants. |
It is generated by Sloeber but I think that it is Windows that removes the quotes as it passes the parameter value to the executable. |
Since it was generated by Sloeber, I'd guess they are not generating it correctly. The quotes are considered optional on all platforms and can be stripped by the shell (even on linux). I'd still suggest open a bug for Sloeber so they can work on a proper fix since they are breaking it with their template. As for when I used Sloeber, I used it on windows for the ESP8266 and Arduino. I use Eclipse itself for other languages and targets but no longer for Arduino/ESP8266 and never for ESP32 (it wasn't supported at the time). |
* Replaced ARDUINO_VARIANT with const char * Fixed missing return value * Added quotes around defined value in macro (Issue #2193) * Change logging from Error to Verbose when not found and default available * Move Enter and Exit logging to Verbose Level * Refactored LOG_X() into log_x()
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
Getting the same problem using eclipse, arduino core as a plugin |
@ankit-thealchemist file an issue against the arduino plugin for eclipse... |
Hardware:
Board: ESP32 Dev Module
Core Installation/update date: commit ec3a97b (dec 15)
IDE name: Eclipse / Sloeber 4.3 plugin
Computer OS: Windows 10
Description:
On compilation of the ESPmDNS component the following code results in an error
error: 'esp32' was not declared in this scope
because the macro ARDUINO_VARIANT is replaced by esp32 and not by the string "esp32"
The text was updated successfully, but these errors were encountered: