Error request for member which is of non class type arduino

АХТУНГ! Вставка от модератора: Подробное руководство по загрузке прошивки в Ардуино от Алекса Гайвера: Прежде чем строчить сообщения, внимательно ознакомьтесь!!! ===================================================================================================== Здраствуйте, у меня...

  • #1

АХТУНГ!
Вставка от модератора:
Подробное руководство по загрузке прошивки в Ардуино от Алекса Гайвера:

Прежде чем строчить сообщения, внимательно ознакомьтесь!!!

=====================================================================================================

Здраствуйте, у меня возникла ошибка с компиляцией скетча, всё сделал по инструкции, несколько раз всё перепроверил, но всё равно возникает ошибка
Arduino: 1.6.4 (Windows 7), Плата»Arduino Nano, ATmega328″

In file included from C:Program FilesArduinolibrariesLCD_1602_RUS-master/LCD_1602_RUS.h:1:0,
from money_box_counter.ino:35:
C:Program FilesArduinolibrariesLCD_1602_RUS-master/LiquidCrystal_I2C.h:7:18: fatal error: Wire.h: No such file or directory
#include <Wire.h>
^
compilation terminated.
Ошибка компиляции.

Безымянный.png

Изменено: 19 Мар 2020

  • #2

Написано же четко.
fatal error: Wire.h: No such file or directory
#include <Wire.h>
библеотека Wire.h — Данный файл или каталог отсутствует

  • #3

Не могу запрограммировать Arduino. Не было под рукой всех нужных деталей,поэтому сделал на микрофоне,который Алекс НЕ советовал,но вариантов не было. Суть не в этом. Вылезает ошибка компиляции. Библиотеки заново копировал по нескольку раз и не помогает. С проектом Ambilight тоже была такая же проблема. Не мог найти какой-то файл. Что делать? OTdrAa-0H7k.jpg1546930986412.png

  • #4

Всем привет!

Нужна помощь, скетч «CUBE_Gyver.ino» грузится на ура, а вот «CUBE_Gyver_v2.ino». Библиотека GyverButton взята из архива с проектом.

G:LEDcube-masterCUBE_Gyver_v2CUBE_Gyver_v2.ino: In function ‘void setup()’:

CUBE_Gyver_v2:132:9: error: ‘class GButton’ has no member named ‘setStepTimeout’

butt1.setStepTimeout(100); // настрйока интервала инкремента (по умолчанию 800 мс)

^

CUBE_Gyver_v2:133:9: error: ‘class GButton’ has no member named ‘setStepTimeout’

butt2.setStepTimeout(100); // настрйока интервала инкремента (по умолчанию 800 мс)

^

G:LEDcube-masterCUBE_Gyver_v2CUBE_Gyver_v2.ino: In function ‘void loop()’:

CUBE_Gyver_v2:144:13: error: ‘class GButton’ has no member named ‘isClick’

if (butt1.isClick()) {

^

CUBE_Gyver_v2:149:13: error: ‘class GButton’ has no member named ‘isClick’

if (butt2.isClick()) {

^

CUBE_Gyver_v2:155:13: error: ‘class GButton’ has no member named ‘isStep’

if (butt1.isStep()) { // если кнопка была удержана (это для инкремента)

^

CUBE_Gyver_v2:158:13: error: ‘class GButton’ has no member named ‘isStep’

if (butt2.isStep()) { // если кнопка была удержана (это для инкремента)

^

Используем библиотеку SPI версии 1.0 из папки: C:Program Files (x86)ArduinohardwarearduinoavrlibrariesSPI
Используем библиотеку GyverButton в папке: C:Program Files (x86)ArduinolibrariesGyverButton (legacy)
Используем библиотеку GyverHacks в папке: C:Program Files (x86)ArduinolibrariesGyverHacks (legacy)
Используем библиотеку GyverTimer в папке: C:Program Files (x86)ArduinolibrariesGyverTimer (legacy)
Используем библиотеку EEPROM версии 2.0 из папки: C:Program Files (x86)ArduinohardwarearduinoavrlibrariesEEPROM
exit status 1
‘class GButton’ has no member named ‘setStepTimeout’

Если брать самую последнюю версию библиотеки GyverButton отсюда https://community.alexgyver.ru/resources/biblioteka-gyverbutton.1/

для CUBE_Gyver.ino

G:LEDcube-masterCUBE_GyverCUBE_Gyver.ino: In function ‘void setup()’:

CUBE_Gyver:82:9: error: ‘class GButton’ has no member named ‘setIncrStep’

butt1.setIncrStep(5); // настройка инкремента, может быть отрицательным (по умолчанию 1)

^

CUBE_Gyver:83:9: error: ‘class GButton’ has no member named ‘setIncrTimeout’

butt1.setIncrTimeout(100); // настрйока интервала инкремента (по умолчанию 800 мс)

^

CUBE_Gyver:84:9: error: ‘class GButton’ has no member named ‘setIncrStep’

butt2.setIncrStep(-5); // настройка инкремента, может быть отрицательным (по умолчанию 1)

^

CUBE_Gyver:85:9: error: ‘class GButton’ has no member named ‘setIncrTimeout’

butt2.setIncrTimeout(100); // настрйока интервала инкремента (по умолчанию 800 мс)

^

G:LEDcube-masterCUBE_GyverCUBE_Gyver.ino: In function ‘void loop()’:

CUBE_Gyver:106:13: error: ‘class GButton’ has no member named ‘isIncr’

if (butt1.isIncr()) { // если кнопка была удержана (это для инкремента)

^

CUBE_Gyver:107:23: error: ‘class GButton’ has no member named ‘getIncr’

modeTimer = butt1.getIncr(modeTimer); // увеличивать/уменьшать переменную value с шагом и интервалом

^

CUBE_Gyver:109:13: error: ‘class GButton’ has no member named ‘isIncr’

if (butt2.isIncr()) { // если кнопка была удержана (это для инкремента)

^

CUBE_Gyver:110:23: error: ‘class GButton’ has no member named ‘getIncr’

modeTimer = butt2.getIncr(modeTimer); // увеличивать/уменьшать переменную value с шагом и интервалом

^

Используем библиотеку SPI версии 1.0 из папки: C:Program Files (x86)ArduinohardwarearduinoavrlibrariesSPI
Используем библиотеку GyverButton в папке: C:Program Files (x86)ArduinolibrariesGyverButton (legacy)
exit status 1
‘class GButton’ has no member named ‘setIncrStep’

для CUBE_Gyver_v2.ino

C:Program Files (x86)ArduinolibrariesGyverHacksGyverHacks.cpp:326:1: error: prototype for ‘GTimer::GTimer(uint16_t)’ does not match any in class ‘GTimer’

GTimer::GTimer(uint16_t interval) {

^

In file included from C:Program Files (x86)ArduinolibrariesGyverHacksGyverHacks.cpp:1:0:

C:Program Files (x86)ArduinolibrariesGyverHacksGyverHacks.h:99:7: error: candidates are: constexpr GTimer::GTimer(GTimer&&)

class GTimer

^

C:Program Files (x86)ArduinolibrariesGyverHacksGyverHacks.h:99:7: error: constexpr GTimer::GTimer(const GTimer&)

C:Program Files (x86)ArduinolibrariesGyverHacksGyverHacks.h:103:2: error: GTimer::GTimer(uint32_t)

GTimer(uint32_t); // объявление таймера с указанием интервала

^

C:Program Files (x86)ArduinolibrariesGyverHacksGyverHacks.cpp:324:1: error: GTimer::GTimer()

GTimer::GTimer() {}

^

C:Program Files (x86)ArduinolibrariesGyverHacksGyverHacks.cpp:331:6: error: prototype for ‘void GTimer::setInterval(uint16_t)’ does not match any in class ‘GTimer’

void GTimer::setInterval(uint16_t interval) {

^

In file included from C:Program Files (x86)ArduinolibrariesGyverHacksGyverHacks.cpp:1:0:

C:Program Files (x86)ArduinolibrariesGyverHacksGyverHacks.h:104:7: error: candidate is: void GTimer::setInterval(uint32_t)

void setInterval(uint32_t); // установка интервала

^

Используем библиотеку SPI версии 1.0 из папки: C:Program Files (x86)ArduinohardwarearduinoavrlibrariesSPI
Используем библиотеку GyverButton в папке: C:Program Files (x86)ArduinolibrariesGyverButton (legacy)
Используем библиотеку GyverHacks в папке: C:Program Files (x86)ArduinolibrariesGyverHacks (legacy)
Используем библиотеку GyverTimer в папке: C:Program Files (x86)ArduinolibrariesGyverTimer (legacy)
Используем библиотеку EEPROM версии 2.0 из папки: C:Program Files (x86)ArduinohardwarearduinoavrlibrariesEEPROM
exit status 1
Ошибка компиляции для платы Arduino Nano.

p.s тапками не кидайте, опыт с ардуино первый. В имеющейся инфе не нашел ответа.

Александр Симонов


  • #6

Спасибо, помогло.

Взял все три библиотеки оттуда (GyverButton, GyverHacks, GyverTimer).

p.s. а для CUBE_Gyver.ino запихать в одноименную папку .h и .cpp файл библиотеки GyverButton из архива со скетчами (со свежей версией скетч в ошибке).

Изменено: 5 Фев 2019

  • #7

Доброго дня. ничего не могу сделать. При компиляции выдает ошибку
exit status 1
‘GButton’ does not name a type
и подсвечена 38 строчка скетча.
GButton touch(BTN_PIN, LOW_PULL, NORM_OPEN);
Все делал по инструкции.
Может кто-то сталкивался с такой траблой?
и 70 строка
GButton touch(BTN_PIN, LOW_PULL, NORM_OPEN);

ошибка
exit status 1
‘LOW_PULL’ was not declared in this scope

Изменено: 10 Мар 2019

Александр Симонов


  • #8

Библиотека GyverButton не установлена

  • #9

Разобрался сам. в настройках Arduino IDE библиотека бралась не та, которая шла с проектом. Решение — удалил не нужную и ошибка пропала.
Спасибо!

  • #10

Создала проект, сейчас компилятор выводит ошибку. Помогите пожалуйста с этой проблемой, я новенькая в этом деле..

Вот:
In function ‘global constructors keyed to 65535_0_sketch_mar14a.ino.cpp.o’:

lto1.exe: internal compiler error: Segmentation fault

Please submit a full bug report,

with preprocessed source if appropriate.

See <http://gcc.gnu.org/bugs.html> for instructions.

lto-wrapper.exe: fatal error: C:Program FilesWindowsAppsArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtthardwaretoolsavr/bin/avr-gcc returned 1 exit status

compilation terminated.

c:/program files/windowsapps/arduinollc.arduinoide_1.8.19.0_x86__mdqgnx93n4wtt/hardware/tools/avr/bin/../lib/gcc/avr/5.4.0/../../../../avr/bin/ld.exe: error: lto-wrapper failed

collect2.exe: error: ld returned 1 exit status

exit status 1
Ошибка компиляции для платы Arduino/Genuino Uno.

Александр Симонов


Александр Симонов


  • #12

Ответ, оказывается, есть в гугле. Проблема именно в баге компилятора. Для решения:
1. установить последнюю версию Arduino IDE
2. В меню «Инструменты — Плата — Менеджер плат» найти Arduino AVR Boards, выбрать версию 1.6.21 и установить её.
1552649944200.png

be3um4wka


  • #13

Здравствуйте. Помогите пожалуйста! Хотел собрать в первый раз что-то на ардуино, решил сделать bluetooth матрицу с часами, но на плату не ставится код. Места хватает и драва под плату установил, проблема в чём-то другом. Заранее спасибо…
P.S. Плата не оригинальная. Заказывал с али. Её название: WAVGAT UNO R3.

Александр Симонов


  • #14

Какую конкретно ошибку выдает Arduino IDE при загрузке скетча?

be3um4wka


  • #15

Какую конкретно ошибку выдает Arduino IDE при загрузке скетча?

Ошибка конфигурации платы WAVGAT UNO R3

  • #16

Столкнулся с проблемой при компиляции версии 1.3 в плату (лог во вложении)
Версии 1.1 и 1.2 заливаются без проблем.
Версия софта 1.8.9
Плата Arduino Nano (из ссылки под видео).
В настройках выбираю чип: ATMega328 Старый загрузчик (пробовал и все остальные), плату: Arduino Nano
Пробовал отрубать библиотеки стандартные и брать только из папки с проектом (кроме FastLED-stm32patch — её в версию 1.3 не включено)

В версии 1.3 ошибка fillAll что конкретно правилось? по поиску исправлений не нашёл.

  • 2.9 KB
    Просмотры: 20

pavel lolkek


  • #17

Доброго времяни суток . Можете помочь не могу загрузить прошивку вылазиет такая ошибка :
Arduino: 1.6.5 (Windows 7), Плата»Arduino Nano, ATmega328″

colorMusic_v2.9.ino:195:50: fatal error: FHT.h: No such file or directory
compilation terminated.
Ошибка компиляции.

pavel lolkek


  • #19

прочитал . выбираю архив и выходит это :

Выбранная папка/zip файл не содержит корректных библиотек
Неверная библиотека найдена в C:UsersuserDocumentsArduinolibrariesColorMusic-master: нет заголовочных файлов (.h), найденных в C:UsersuserDocumentsArduinolibrariesColorMusic-master

  • #20

Здравствуйте не могу загрузить скетч в ардуино выдает такую ошибку
(Ошибка компиляции для платы Arduino Nano.
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesDHT: нет заголовочных файлов (.h), найденных в C:Program Files (x86)ArduinolibrariesDHT
Неверная библиотека найдена в C:UsersuserDocumentsArduinolibrariessketch_nov30a: нет заголовочных файлов (.h), найденных в C:UsersuserDocumentsArduinolibrariessketch_nov30a) помогите кто чем может. С уважением ко Всем.

  • #21

@Максим3704, либо не та библиотека для датчика температуры. Либо не там лежит. У меня лежит в папке /мои документы /arduino ide /libraries

Библиотеки отличаются для одних и тех же датчиков. Сам перебрал кучу, пока нашёл нужную

be3um4wka


  • #22

Какую конкретно ошибку выдает Arduino IDE при загрузке скетча?

Arduino: 1.8.9 (Windows 10), Плата:"WAVGAT UNO R3"
Внимание: platform.txt из ядра 'Arduino AVR Boards' содержит устаревшие recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", автоматически преобразовано в recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Ожидайте обновления ядра.
In file included from C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/platforms/avr/fastled_avr.h:6:0,
                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/platforms.h:27,
                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/FastLED.h:55,
                 from C:GyverMatrixOS_v1.11GyverMatrixOS_v1.11.ino:137:
C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/platforms/avr/clockless_trinket.h:74:0: warning: "D1" redefined
#define D1(ADJ) DINT(T1,ADJ)
^
In file included from C:Program Files (x86)ArduinohardwareWAVavrvariantslgt8fx8p/pins_arduino.h:36:0,
                 from C:Program Files (x86)ArduinohardwareWAVavrcoreslgt8f/Arduino.h:225,
                 from sketchGyverMatrixOS_v1.11.ino.cpp:1:
c:program files (x86)arduinohardwarewavavrvariantsstandardpins_arduino.h:82:0: note: this is the location of the previous definition
#define D1 1 /* PD1 */
^
In file included from C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/platforms/avr/fastled_avr.h:6:0,
                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/platforms.h:27,
                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/FastLED.h:55,
                 from C:GyverMatrixOS_v1.11GyverMatrixOS_v1.11.ino:137:

C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/platforms/avr/clockless_trinket.h:75:0: warning: "D2" redefined

#define D2(ADJ) DINT(T2,ADJ)

^

In file included from C:Program Files (x86)ArduinohardwareWAVavrvariantslgt8fx8p/pins_arduino.h:36:0,

                 from C:Program Files (x86)ArduinohardwareWAVavrcoreslgt8f/Arduino.h:225,

                 from sketchGyverMatrixOS_v1.11.ino.cpp:1:

c:program files (x86)arduinohardwarewavavrvariantsstandardpins_arduino.h:83:0: note: this is the location of the previous definition

#define D2 2 /* PD2 */

^

In file included from C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/platforms/avr/fastled_avr.h:6:0,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/platforms.h:27,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/FastLED.h:55,

                 from C:GyverMatrixOS_v1.11GyverMatrixOS_v1.11.ino:137:

C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/platforms/avr/clockless_trinket.h:76:0: warning: "D3" redefined

#define D3(ADJ) DINT(T3,ADJ)

^

In file included from C:Program Files (x86)ArduinohardwareWAVavrvariantslgt8fx8p/pins_arduino.h:36:0,

                 from C:Program Files (x86)ArduinohardwareWAVavrcoreslgt8f/Arduino.h:225,

                 from sketchGyverMatrixOS_v1.11.ino.cpp:1:

c:program files (x86)arduinohardwarewavavrvariantsstandardpins_arduino.h:84:0: note: this is the location of the previous definition

#define D3 3 /* PD3 */

^

In file included from C:GyverMatrixOS_v1.11GyverMatrixOS_v1.11.ino:137:0:

C:Program Files (x86)ArduinolibrariesFastLED-stm32patch/FastLED.h:17:21: note: #pragma message: FastLED version 3.002.000

#    pragma message "FastLED version 3.002.000"

                     ^

In file included from C:GyverMatrixOS_v1.11GyverMatrixOS_v1.11.ino:171:0:

sketchtimerMinim.h:10:23: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11

     uint32_t _timer = 0;

                       ^

sketchtimerMinim.h:11:26: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11

     uint32_t _interval = 0;

                          ^

C:GyverMatrixOS_v1.11g_tetris.ino:13:20: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11

uint32_t colors[6] {0x0000EE, 0xEE0000, 0x00EE00, 0x00EEEE, 0xEE00EE, 0xEEEE00};

                    ^

In file included from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchplatforms/avr/fastled_avr.h:6:0,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchplatforms.h:27,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.h:55,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.cpp:2:

C:Program Files (x86)ArduinolibrariesFastLED-stm32patchplatforms/avr/clockless_trinket.h:74:0: warning: "D1" redefined

#define D1(ADJ) DINT(T1,ADJ)

^

In file included from C:Program Files (x86)ArduinohardwareWAVavrvariantslgt8fx8p/pins_arduino.h:36:0,

                 from C:Program Files (x86)ArduinohardwareWAVavrcoreslgt8f/Arduino.h:225,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchled_sysdefs.h:38,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.h:44,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.cpp:2:

c:program files (x86)arduinohardwarewavavrvariantsstandardpins_arduino.h:82:0: note: this is the location of the previous definition

#define D1 1 /* PD1 */

^

In file included from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchplatforms/avr/fastled_avr.h:6:0,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchplatforms.h:27,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.h:55,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.cpp:2:

C:Program Files (x86)ArduinolibrariesFastLED-stm32patchplatforms/avr/clockless_trinket.h:75:0: warning: "D2" redefined

#define D2(ADJ) DINT(T2,ADJ)

^

In file included from C:Program Files (x86)ArduinohardwareWAVavrvariantslgt8fx8p/pins_arduino.h:36:0,

                 from C:Program Files (x86)ArduinohardwareWAVavrcoreslgt8f/Arduino.h:225,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchled_sysdefs.h:38,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.h:44,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.cpp:2:

c:program files (x86)arduinohardwarewavavrvariantsstandardpins_arduino.h:83:0: note: this is the location of the previous definition

#define D2 2 /* PD2 */

^

In file included from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchplatforms/avr/fastled_avr.h:6:0,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchplatforms.h:27,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.h:55,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.cpp:2:

C:Program Files (x86)ArduinolibrariesFastLED-stm32patchplatforms/avr/clockless_trinket.h:76:0: warning: "D3" redefined

#define D3(ADJ) DINT(T3,ADJ)

^

In file included from C:Program Files (x86)ArduinohardwareWAVavrvariantslgt8fx8p/pins_arduino.h:36:0,

                 from C:Program Files (x86)ArduinohardwareWAVavrcoreslgt8f/Arduino.h:225,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchled_sysdefs.h:38,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.h:44,

                 from C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.cpp:2:

c:program files (x86)arduinohardwarewavavrvariantsstandardpins_arduino.h:84:0: note: this is the location of the previous definition

#define D3 3 /* PD3 */

^

C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.cpp: In member function 'void CFastLED::delay(long unsigned int)':

C:Program Files (x86)ArduinolibrariesFastLED-stm32patchFastLED.cpp:132:9: error: 'yield' was not declared in this scope

   yield();

         ^

exit status 1

Ошибка компиляции для платы WAVGAT UNO R3.



Этот отчёт будет иметь больше информации с

включенной опцией Файл -> Настройки ->

"Показать подробный вывод во время компиляции"

Изменено: 16 Апр 2019

Wan-Derer


  • #23

@be3um4wka, Дай ссылку на свою плату или сделай фото, крупно чтобы читались все надписи на микросхемах

  • #24

Чтото не заработал полив, собрал все по схеме, вкл через малый промежуток времени, ставил на часа два, три и нивкакую. похоже библиотека всему виной наверно не туда сохранил или еще что, выбивало ошибку Неверная библиотека найдена в C:Program Files (x86)Arduinolibrarieslibraries: нет заголовочных файлов (.h), найденных в C:Program Files (x86)

  • #25

Arduino: 1.6.5 (Windows 7), Плата»Arduino Nano, ATmega328″

In file included from colorMusic_v2.7_Effect_Mic_and_Line.ino:236:0:
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRLremote.h:29:2: error: #error IRLremote requires Arduino IDE 1.6.6 or greater. Please update your IDE.
#error IRLremote requires Arduino IDE 1.6.6 or greater. Please update your IDE.
^
In file included from colorMusic_v2.7_Effect_Mic_and_Line.ino:227:0:
C:Program Files (x86)ArduinolibrariesFastLED-master/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.008
# pragma message «FastLED version 3.001.008»
^
In file included from C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Nec.h:28:0,
from C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRLremote.h:44,
from colorMusic_v2.7_Effect_Mic_and_Line.ino:236:
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Time.h: In member function ‘uint32_t CIRL_Time<T>::nextEvent()’:
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Time.h:135:10: error: ‘time’ does not name a type
auto time = timeout();
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Time.h:136:10: error: ‘timespan’ does not name a type
auto timespan = static_cast<T*>(this)->timespanEvent;
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Time.h:138:8: error: ‘time’ was not declared in this scope
if(time >= timespan) {
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Time.h:138:16: error: ‘timespan’ was not declared in this scope
if(time >= timespan) {
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Time.h:142:12: error: ‘timespan’ was not declared in this scope
return timespan — time;
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Time.h:142:23: error: ‘time’ was not declared in this scope
return timespan — time;
^
In file included from C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Nec.h:30:0,
from C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRLremote.h:44,
from colorMusic_v2.7_Effect_Mic_and_Line.ino:236:
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Decode.h: In static member function ‘static void CIRL_DecodeSpaces<T, blocks>::interrupt()’:
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Decode.h:100:10: error: ‘duration’ does not name a type
auto duration = T::nextTime();
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Decode.h:103:9: error: ‘duration’ was not declared in this scope
if (duration >= T::limitTimeout) {
^
In file included from C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRLremote.h:45:0,
from colorMusic_v2.7_Effect_Mic_and_Line.ino:236:
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h: In member function ‘void CNecAPI<callback, address>::read()’:
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h:72:8: error: ‘data’ does not name a type
auto data = CNec::read();
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h:75:28: error: request for member ‘address’ in ‘CIRL_DecodeSpaces<CNec, 4>::data’, which is of non-class type ‘uint8_t [4] {aka unsigned char [4]}’
bool firstCommand = data.address != 0xFFFF;
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h:76:13: error: request for member ‘address’ in ‘CIRL_DecodeSpaces<CNec, 4>::data’, which is of non-class type ‘uint8_t [4] {aka unsigned char [4]}’
if ((data.address == 0) || (address && firstCommand && (data.address != address)))
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h:76:64: error: request for member ‘address’ in ‘CIRL_DecodeSpaces<CNec, 4>::data’, which is of non-class type ‘uint8_t [4] {aka unsigned char [4]}’
if ((data.address == 0) || (address && firstCommand && (data.address != address)))
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h:96:14: error: request for member ‘command’ in ‘CIRL_DecodeSpaces<CNec, 4>::data’, which is of non-class type ‘uint8_t [4] {aka unsigned char [4]}’
if (data.command == lastCommand)
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h:124:24: error: request for member ‘command’ in ‘CIRL_DecodeSpaces<CNec, 4>::data’, which is of non-class type ‘uint8_t [4] {aka unsigned char [4]}’
lastCommand = data.command;
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h: In member function ‘uint32_t CNecAPI<callback, address>::nextTimeout()’:
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h:205:10: error: ‘time’ does not name a type
auto time = timeout();
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h:206:10: error: ‘timeout’ does not name a type
auto timeout = getTimeout();
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h:208:8: error: ‘time’ was not declared in this scope
if(time >= timeout) {
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_NecAPI.h:212:22: error: ‘time’ was not declared in this scope
return timeout — time;
^
In file included from C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRLremote.h:47:0,
from colorMusic_v2.7_Effect_Mic_and_Line.ino:236:
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Hash.h: In static member function ‘static void CHashIR::interrupt()’:
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Hash.h:180:10: error: ‘duration’ does not name a type
auto duration = nextTime();
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Hash.h:183:8: error: ‘duration’ was not declared in this scope
if(duration >= HASHIR_TIMEOUT)
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Hash.h:213:18: error: ‘oldval’ does not name a type
auto oldval = lastDuration;
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Hash.h:214:18: error: ‘newval’ does not name a type
auto newval = duration;
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Hash.h:220:17: error: ‘newval’ was not declared in this scope
if (newval < (oldval * 3 / 4)) {
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Hash.h:220:27: error: ‘oldval’ was not declared in this scope
if (newval < (oldval * 3 / 4)) {
^
C:Program Files (x86)ArduinolibrariesIRLremote-mastersrc/IRL_Hash.h:240:28: error: ‘duration’ was not declared in this scope
lastDuration = duration;
^
colorMusic_v2.7_Effect_Mic_and_Line.ino: In function ‘void remoteTick()’:
colorMusic_v2.7_Effect_Mic_and_Line:848: error: ‘data’ does not name a type
colorMusic_v2.7_Effect_Mic_and_Line:849: error: ‘data’ was not declared in this scope
‘data’ does not name a type

WARNING: Spurious .github folder in ‘Adafruit NeoPixel’ library

WARNING: Spurious .github folder in ‘Adafruit NeoPixel’ library

Это сообщение будет содержать больше информации чем
«Отображать вывод во время компиляции»
включено в Файл > Настройки

This topic has been deleted. Only users with topic management privileges can see it.

  • I’m trying to make an Arduino library for GY521. Created .cpp and .h files and also completed the code. But I’m getting an error while calling library function via main code.

    look my code below or via project repo

    Accelometer:10:7: error: request for member 'getAcData' in 'goo', which is of non-class type 'Gy521()'
       goo.getAcData();
           ^~~~~~~~~
    Accelometer:11:7: error: request for member 'getGyData' in 'goo', which is of non-class type 'Gy521()'
       goo.getGyData();
    

    Accelometer.ino (main code):

    //#include <Wire.h>
    #include "Gy521.h"
    
    Gy521 goo();
    
    void setup(){
      Serial.begin(9600);
    }
    void loop(){
      goo.getAcData();
      goo.getGyData();
    }
    

    Gy521.cpp

    #include "Gy521.h"
    #include "Arduino.h"
    #include <Wire.h>
    
    Gy521::Gy521()
    {
      Wire.begin();
      Wire.beginTransmission(_MPU);
      Wire.write(0x6B); 
      Wire.write(0);    
      Wire.endTransmission(true);
    }
    
    void Gy521::getAcData(){
      Wire.beginTransmission(_MPU);
      Wire.write(0x3B);  
      Wire.endTransmission(false);
      Wire.requestFrom(_MPU,6,true);  
      AcX=Wire.read()<<8|Wire.read();    
      AcY=Wire.read()<<8|Wire.read();  
      AcZ=Wire.read()<<8|Wire.read();   
     
      Serial.print("Accelerometer: ");
      Serial.print("X = "); Serial.print(AcX);
      Serial.print(" | Y = "); Serial.print(AcY);
      Serial.print(" | Z = "); Serial.println(AcZ);  
    }
    void Gy521::getGyData(){
      Wire.beginTransmission(_MPU);
      Wire.write(0x43);  
      Wire.endTransmission(false);
      Wire.requestFrom(_MPU,6,true);  
       
      GyX=Wire.read()<<8|Wire.read();  
      GyY=Wire.read()<<8|Wire.read();  
      GyZ=Wire.read()<<8|Wire.read();
      
      Serial.print("Gyroscope: ");
      Serial.print("X = "); Serial.print(GyX);
      Serial.print(" | Y = "); Serial.print(GyY);
      Serial.print(" | Z = "); Serial.println(GyZ);
      Serial.println(" ");
      delay(100);
    }
    
    

    Gy521.h

    #ifndef Gy521_h
    #define Gy521_h
    
    #include "Arduino.h"
    class Gy521
    {
      public:
        Gy521();
        void getAcData();
        void getGyData();
        int16_t GyX,GyY,GyZ;
        int16_t AcX,AcY,AcZ;
            
      private:
        const int _MPU = 0x68;
    };
    
    
    
    #endif
    

    :- This is my first try to make an Arduino Library 🙂

  • When you want to create an object of a class and it doesn’t take in any parameters, then

    Gy521 goo;  //object declaration
    

    is enough. Then invoke the initialization function,

    goo.begin();  //initialization
    

    For that, you need to create an initialization function. You can copy the statements in your constructor there.

  • @vishnumaiea Thank you. I made the changes, it worked well.
    Next, I want to return 3 variables in getAcData() function. Is there any way to do this ? Can i access AcX,AcY,AcZ globally via main code.

  • @rafitc99 The member variables of a class can not be accessed without an accompanying object; that’s the concept of a class. If you want to return three values, simply update the member variables AcX, Ac and AcZ, and access them as,

    Serial.println(goo.AcX);
    Serial.println(goo.AcY);
    Serial.println(goo.AcZ);
    
  • @vishnumaiea

    Serial.println(goo.AcX);
    Serial.println(goo.AcY);
    Serial.println(goo.AcZ);
    

    while using above code, I’m getting ‘0’. not updating,

  • @rafitc99 is it fixed ?,u found a solution?

  • @saheen_palayi Nop, while calling goo.AcX getting zero as output. not getting updated value.

  • @rafitc99 I dont think u can access those like that did you tried those lines after

     goo.getAcData();
     goo.getGyData();
    
  • @saheen_palayi yeah! that was the problem. Now it’s worked. Thank you @saheen_palayi and @vishnumaiea

  • @rafitc99 What was the solution?

    • Forum
    • General C++ Programming
    • request for member of non class type?

    request for member of non class type?

    When I run my code I get this error and I don’t know how to fix it.

    error: request for member ‘push_back’ in ‘v’, which is of non-class type ‘Vector<int>()’|

    Here’s my updated code.

    Vector.h

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    #ifndef VECTOR_H_INCLUDED
    #define VECTOR_H_INCLUDED
    
    template <class T>
    class Vector
    {
    private:
       unsigned int my_size;
       unsigned int my_capacity;
       T * buffer;
    
    public:
    
       //Vector;
       Vector();
       void push_back(const T & x);
       int resize(int size);
    };
    
    #endif // VECTOR_H_INCLUDED 

    Vector.cpp

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    #include <iostream>
    #include "Vector.h"
    
    using namespace std;
    
    template <class T>
    Vector<T>::Vector()
    {
    	my_size = 0;
    	my_capacity = 0;
    	buffer = nullptr;
    }
    
    template <class T>
    void Vector<T>::push_back(const T &x)
    {
        if(my_size == my_capacity)
        {
            resize(my_capacity+5);
        }
        buffer[my_size] = x;
        my_size++;
    }
    
    template <class T>
    int Vector<T>::resize(int size)
    {
        if(buffer == nullptr)
        {
            buffer = new T[size];
            my_capacity = size;
        }
        else{
            T * newBuffer = new T[size];
            for(int i = 0; i < my_size; i++)
            {
                newBuffer[i] = buffer[i];
            }
    
            delete [] buffer;
            buffer = newBuffer;
        }
    }
    

    main.cpp

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    #include <iostream>
    #include <string>
    #include <cassert>
    #include "Vector.h"
    
    using namespace std;
    
    int main()
    {
    
       Vector<int> v;
       //v.push_back(8);
    }
    

    Last edited on

    Vector<int> v(); Declares a function taking no arguments and returning Vector<int>.

    You probably meant Vector<int> v;. This line return an error because you do not have a default constructor for your class.

    Last edited on

    I thought this was my default constructor.

    That is declaration. Where is it defined?

    The error is on line 69. The parameter requires const: push_back(const T &x)

    You have several more errors in resize(…).

    On line 48: missing *
    On line 49: Remove buffer.

    Line 55 and the loop on line 57 don’t make sense. Replace it with buffer = newBuffer;

    Last edited on

    Thanks coder that makes more sense. I still don’t understand my error for using this.

    Here’s my updated code.

    Vector.h

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    #ifndef VECTOR_H_INCLUDED
    #define VECTOR_H_INCLUDED
    
    template <class T>
    class Vector
    {
    private:
       unsigned int my_size;
       unsigned int my_capacity;
       T * buffer;
    
    public:
    
       //Vector;
       Vector();
       void push_back(const T & x);
       int resize(int size);
    };
    
    #endif // VECTOR_H_INCLUDED 

    Vector.cpp

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    #include <iostream>
    #include "Vector.h"
    
    using namespace std;
    
    template <class T>
    Vector<T>::Vector()
    {
    	my_size = 0;
    	my_capacity = 0;
    	buffer = nullptr;
    }
    
    template <class T>
    void Vector<T>::push_back(const T &x)
    {
        if(my_size == my_capacity)
        {
            resize(my_capacity+5);
        }
        buffer[my_size] = x;
        my_size++;
    }
    
    template <class T>
    int Vector<T>::resize(int size)
    {
        if(buffer == nullptr)
        {
            buffer = new T[size];
            my_capacity = size;
        }
        else{
            T * newBuffer = new T[size];
            for(int i = 0; i < my_size; i++)
            {
                newBuffer[i] = buffer[i];
            }
    
            delete [] buffer;
            buffer = newBuffer;
        }
    }
    

    main.cpp

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    #include <iostream>
    #include <string>
    #include <cassert>
    #include "Vector.h"
    
    using namespace std;
    
    int main()
    {
    
       Vector<int> v;
       //v.push_back(8);
    }
    

    Last edited on

    Thanks coder that makes more sense. I still don’t understand my error for using this.

    Is there still an error? The line itself is ok.

    Topic archived. No new replies allowed.

    Понравилась статья? Поделить с друзьями:
  • Error response from daemon invalid subnet invalid cidr address
  • Error request failed with status code 504
  • Error response from daemon i o timeout docker
  • Error request failed with status code 499
  • Error response from daemon get x509 certificate signed by unknown authority