We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What kind of issue is this?
Operating system: OS X El Capitan 10.11.3 (15D21)
PlatformIO Version (platformio --version): PlatformIO, version 2.8.6
platformio --version
Attempting to compile the attached code causes a variable or field ... declared void error, followed by ... not declared in this scope errors.
variable or field ... declared void
... not declared in this scope
platform_test.ino
platformio run
[Sat Apr 9 12:36:22 2016] Processing uno (platform: atmelavr, board: uno, framework: arduino) ---------------------------------------------------------------------------------------------------------------------------------------- avr-g++ -o .pioenvs/uno/src/tmp_ino_to.o -c -fno-exceptions -fno-threadsafe-statics -std=gnu++11 -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10608 -DPLATFORMIO=020806 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant src/tmp_ino_to.cpp src/tmp_ino_to.cpp:3:17: error: variable or field 'myFunction' declared void void myFunction(MyEnum bacon); ^ src/tmp_ino_to.cpp:3:17: error: 'MyEnum' was not declared in this scope scons: *** [.pioenvs/uno/src/tmp_ino_to.o] Error 1 ===================================================== [ ERROR ] Took 0.41 seconds ===================================================== 09Apr2016 12:36:23 <wild@WildBookPro:~/Documents/Arduino/platformio_test> platformio run [Sat Apr 9 12:36:37 2016] Processing uno (platform: atmelavr, board: uno, framework: arduino) ---------------------------------------------------------------------------------------------------------------------------------------- avr-g++ -o .pioenvs/uno/src/tmp_ino_to.o -c -fno-exceptions -fno-threadsafe-statics -std=gnu++11 -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=10608 -DPLATFORMIO=020806 -I.pioenvs/uno/FrameworkArduino -I.pioenvs/uno/FrameworkArduinoVariant src/tmp_ino_to.cpp src/tmp_ino_to.cpp:7:17: error: variable or field 'myFunction' declared void void myFunction(MyEnum bacon); ^ src/tmp_ino_to.cpp:7:17: error: 'MyEnum' was not declared in this scope platformio_test.ino: In function 'void loop()': platformio_test.ino:11:19: error: 'myFunction' was not declared in this scope scons: *** [.pioenvs/uno/src/tmp_ino_to.o] Error 1 ===================================================== [ ERROR ] Took 0.39 seconds =====================================================
Successful compilation
The content of platformio.ini:
platformio.ini
[env:uno] platform = atmelavr framework = arduino board = uno
Source file (platform_test.ino) to reproduce issue:
enum MyEnum { X, Y, Z }; void setup() { Serial.begin(9600); } void loop() { MyEnum crunchy = X; myFunction(crunchy); } void myFunction(MyEnum bacon) { if (bacon == X) { Serial.println("x"); } else { Serial.println("not x"); } }
The text was updated successfully, but these errors were encountered:
Temporary solution:
.cpp
#include <Arduino.h>
Sorry, something went wrong.
Confirmed. The following code compiles successfully.
platformio_test.cpp:
platformio_test.cpp
#include <Arduino.h> enum MyEnum { X, Y, Z }; void myFunction(MyEnum bacon); void setup() { Serial.begin(9600); } void loop() { MyEnum crunchy = X; myFunction(crunchy); } void myFunction(MyEnum bacon) { if (bacon == X) { Serial.println("x"); } else { Serial.println("not x"); } }
Moving things around to work on platformio
64c5a42
Note: platformio v2.8.6 has a bug preventing this from fully working. platformio/platformio-core#610
00b76e6
Optimise converter from ini to cpp // Issue #610
2682e8d
Use Unix path while converting INO to CPP // Issue #610
4c80a02
Version bump to 2.9.0 (issues #438, #472, #480, #535, #559, #576, #585,
9b86fdc
#590, #596, #598, #599, #600, #601, #602, #604, #609, #610, #613, #616, #618, #626, #627, #631, #632, #633, #635, #636, #637)
ivankravets
No branches or pull requests
What kind of issue is this?
Configuration
Operating system:
OS X El Capitan 10.11.3 (15D21)
PlatformIO Version (
platformio --version
):PlatformIO, version 2.8.6
Description of problem
Attempting to compile the attached code causes a
variable or field ... declared void
error, followed by... not declared in this scope
errors.Steps to Reproduce
platform_test.ino
code as-includedplatformio run
Actual Results
Expected Results
Successful compilation
If problems with PlatformIO Build System:
The content of
platformio.ini
:Source file (
platform_test.ino
) to reproduce issue:Additional info
The text was updated successfully, but these errors were encountered: