I’m currently having a problem with the following error when I try to run my game. I tried to understand what the meaning of the following error but I find it hard to understand. I believe that there is more than one error but I have no clue where to look. I would love to have some help from you!
[armeabi] Compile++ thumb: MyGame_shared <= BallSprite.cpp
[armeabi] Compile++ thumb: MyGame_shared <= Character.cpp
[armeabi] StaticLibrary : libcocos2d.a
[armeabi] StaticLibrary : libcocostudio.a
[armeabi] StaticLibrary : libcocosbuilder.a
[armeabi] StaticLibrary : libcocos3d.a
jni/../../../Classes/Character.cpp:26:5: error: prototype for 'int Character::getTurnCount()' does not match any in class 'Character'
int Character::getTurnCount()
^
In file included from /Users/michael/Desktop/CocoFolder/Puzzle/cocos2d/cocos/3d/../base/CCAsyncTaskPool.h:28:0,
from /Users/michael/Desktop/CocoFolder/Puzzle/cocos2d/cocos/3d/../cocos2d.h:41,
from jni/../../../Classes/Character.h:4,
from jni/../../../Classes/Character.cpp:1:
/Users/michael/Desktop/CocoFolder/Puzzle/cocos2d/cocos/3d/../platform/CCPlatformMacros.h:153:25: error: candidate is: virtual int Character::getTurnCount() const
public: virtual varType get##funName(void) const;
^
jni/../../../Classes/Character.h:26:5: note: in expansion of macro 'CC_PROPERTY'
CC_PROPERTY(int, _turnCount, TurnCount);
^
jni/../../../Classes/BallSprite.cpp:62:27: error: prototype for 'BallSprite::PositionIndex BallSprite::getPositionIndex()' does not match any in class 'BallSprite'
BallSprite::PositionIndex BallSprite::getPositionIndex()
^
In file included from /Users/michael/Desktop/CocoFolder/Puzzle/cocos2d/cocos/3d/../base/CCAsyncTaskPool.h:28:0,
from /Users/michael/Desktop/CocoFolder/Puzzle/cocos2d/cocos/3d/../cocos2d.h:41,
from jni/../../../Classes/BallSprite.h:4,
from jni/../../../Classes/BallSprite.cpp:1:
/Users/michael/Desktop/CocoFolder/Puzzle/cocos2d/cocos/3d/../platform/CCPlatformMacros.h:153:25: error: candidate is: virtual BallSprite::PositionIndex BallSprite::getPositionIndex() const
public: virtual varType get##funName(void) const;
^
jni/../../../Classes/BallSprite.h:53:5: note: in expansion of macro 'CC_PROPERTY'
CC_PROPERTY(PositionIndex, _positionIndex, PositionIndex);
^
make: *** [obj/local/armeabi/objs-debug/MyGame_shared/__/__/__/Classes/BallSprite.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [obj/local/armeabi/objs-debug/MyGame_shared/__/__/__/Classes/Character.o] Error 1
make: Leaving directory `/Users/michael/Desktop/CocoFolder/Puzzle/proj.android-studio/app'
Error running command, return code: 2.
code for the character
#include "Character.h"
USING_NS_CC;
Character::Character()
: _hp(0)
, _maxHp(0)
, _attack(0)
, _element(Element::None)
, _turnCount(0)
, _remainingTurn(0)
{
}
Character* Character::create()
{
Character *pRet = new Character();
pRet->autorelease();
return pRet;
}
int Character::getTurnCount()
{
return _turnCount;
}
void Character::setTurnCount(int turnCount)
{
_turnCount = turnCount;
_remainingTurn = _turnCount;
}
float Character::getHpPercentage()
{
return _hp * 100.f / _maxHp;
}
bool Character::isAttackTurn()
{
_remainingTurn--;
if (_remainingTurn <= 0)
{
_remainingTurn = _turnCount;
return true;
}
return false;
}
int Character::getDamage(int ballCount, int chainCount, Character* attacker, Character* defender)
{
float baseDamage = ballCount / 3.0 * 100;
float chainBonus = powf(1.1, chainCount - 1);
float elementBonus = getElementBonus(attacker->getElement(), defender->getElement());
return baseDamage * chainBonus * elementBonus;
}
float Character::getElementBonus(Element attackElement, Element defenseElement)
{
switch (attackElement)
{
case Element::Fire:
{
switch (defenseElement)
{
case Element::Wind:return 2;
case Element::Water:return 0.5;
default:return 1;
}
break;
}
case Element::Water:
{
switch (defenseElement)
{
case Element::Fire:return 2;
case Element::Wind:return 0.5;
default:return 1;
}
break;
}
case Element::Wind:
{
switch (defenseElement)
{
case Element::Water:return 2;
case Element::Wind:return 0.5;
default:return 1;
}
break;
}
case Element::Holy:
{
switch (defenseElement)
{
case Element::Shadow:return 2;
default:return 1;
}
break;
}
case Element::Shadow:
{
switch (defenseElement)
{
case Element::Holy:return 2;
default:return 1;
}
break;
}
default:
{
return 1;
}
}
}
Characters header
class Character : public cocos2d::Ref
{
public:
enum class Element
{
Fire,
Water,
Wind,
Holy,
Shadow,
None,
};
protected:
int _remainingTurn;
CC_SYNTHESIZE(int, _hp, Hp);
CC_SYNTHESIZE(int, _maxHp, MaxHp);
CC_SYNTHESIZE(int, _attack, Attack);
CC_SYNTHESIZE(Element, _element, Element);
CC_PROPERTY(int, _turnCount, TurnCount);
public:
Character();
static Character* create();
float getHpPercentage();
bool isAttackTurn();
static int getDamage(int ballCount, int chainCount, Character* attacker, Character* defender);
protected:
static float getElementBonus(Element attackElement, Element defenseElement);
};
#endif
BallSprite.cpp
#include "BallSprite.h"
USING_NS_CC;
BallSprite::BallSprite()
: _removedNo(0)
, _checkedX(false)
, _checkedY(false)
, _fallCount(0)
, _positionIndex(0, 0)
{
}
BallSprite* BallSprite::create(BallType type, bool visible)
{
BallSprite *pRet = new BallSprite();
if (pRet && pRet->init(type, visible))
{
pRet->autorelease();
return pRet;
}
else
{
delete pRet;
pRet = nullptr;
return nullptr;
}
}
bool BallSprite::init(BallType type, bool visible)
{
if (!Sprite::initWithFile(getBallImageFilePath(type)))
return false;
_ballType = type;
setVisible(visible);
return true;
}
void BallSprite::resetParams()
{
_removedNo = 0;
_checkedX = false;
_checkedY = false;
_fallCount = 0;
}
void BallSprite::resetPosition()
{
setPosition(getPositionForPositionIndex(_positionIndex));
}
void BallSprite::getPositionIndex()
{
return _positionIndex;
}
void BallSprite::setPositionIndex(PositionIndex positionIndex)
{
_positionIndex = positionIndex;
setTag(generateTag(_positionIndex));
}
void BallSprite::setPositionIndexAndChangePosition(PositionIndex positionIndex)
{
setPositionIndex(positionIndex);
resetPosition();
}
void BallSprite::removingAndFallingAnimation(int maxRemovedNo)
{
removingAnimation(maxRemovedNo);
fallingAnimation(maxRemovedNo);
}
void BallSprite::removingAnimation(int maxRemovedNo)
{
if (_removedNo > 0)
{
auto delay1 = DelayTime::create(ONE_ACTION_TIME * (_removedNo - 1));
auto fade = FadeTo::create(ONE_ACTION_TIME, 0);
auto delay2 = DelayTime::create(ONE_ACTION_TIME * (maxRemovedNo - _removedNo));
auto removeSelf = RemoveSelf::create(false);
runAction(Sequence::create(delay1, fade, delay2, removeSelf, nullptr));
}
}
void BallSprite::fallingAnimation(int maxRemovedNo)
{
if (_fallCount > 0)
{
setPositionIndex(PositionIndex(_positionIndex.x, _positionIndex.y - _fallCount));
auto delay = DelayTime::create(ONE_ACTION_TIME * maxRemovedNo);
auto show = Show::create();
auto move = MoveTo::create(ONE_ACTION_TIME, getPositionForPositionIndex(getPositionIndex()));
runAction(Sequence::create(delay, show, move, nullptr));
}
}
std::string BallSprite::getBallImageFilePath(BallType type)
{
switch (type)
{
case BallType::Red: return "red.png";
case BallType::Blue: return "blue.png";
default: return "pink.png";
}
}
Point BallSprite::getPositionForPositionIndex(PositionIndex positionIndex)
{
return Point(BALL_SIZE * (positionIndex.x - 0.5) + 1,
BALL_SIZE * (positionIndex.y - 0.5) + 1);
}
int BallSprite::generateTag(PositionIndex positionIndex)
{
return positionIndex.x * 10 + positionIndex.y;
}
BallSprite header
#include "cocos2d.h"
#define BALL_SIZE 106
#define ONE_ACTION_TIME 0.2
class BallSprite : public cocos2d::Sprite
{
public:
enum class BallType
{
Blue,
Red,
Green,
Yellow,
Purple,
Pink,
};
struct PositionIndex
{
PositionIndex()
{
x = 0;
y = 0;
}
PositionIndex(int _x, int _y)
{
x = _x;
y = _y;
}
int x;
int y;
};
BallSprite();
static BallSprite* create(BallType type, bool visible);
virtual bool init(BallType type, bool visible);
CC_SYNTHESIZE(int, _removedNo, RemovedNo);
CC_SYNTHESIZE(bool, _checkedX, CheckedX);
CC_SYNTHESIZE(bool, _checkedY, CheckedY);
CC_SYNTHESIZE(int, _fallCount, FallCount);
CC_SYNTHESIZE_READONLY(BallType, _ballType, BallType);
CC_PROPERTY(PositionIndex, _positionIndex, PositionIndex);
void setPositionIndexAndChangePosition(PositionIndex positionIndex);
void resetParams();
void resetPosition();
void removingAndFallingAnimation(int maxRemovedNo);
static std::string getBallImageFilePath(BallType type);
static cocos2d::Point getPositionForPositionIndex(PositionIndex positionIndex);
static int generateTag(PositionIndex positionIndex);
protected:
void removingAnimation(int maxRemovedNo);
void fallingAnimation(int maxRemovedNo);
};
#endif
-
Всем здрасьте.
По вот этому гайдупытаюсь завести аналогичный экранчик. Заканчивается все тем что данный код не компилируется
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h> // Скачанная библиотека для дисплея.
#include <Adafruit_SSD1306.h> // Скачанная библиотека для дисплея. https://yadi.sk/d/9F_uW1wIZUDna
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
void setup(){// У дисплея нету строк и колонок, только Pixel / пиксели по горизонтали и вертикали, условно! назовем курсор / колонка.
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 0.96″ 128X64 OLED LCD Display)I2C АДРЕС.
display.clearDisplay(); // Clear the buffer. / Очистить буфер.
display.setTextColor(WHITE); // Цвет текста.
display.setTextSize(1); // Размер текста (1).
display.setCursor(0,0); // Устанавливаем курсор в колонку 0, строку 0. на самом деле это строка №1, т.к. нумерация начинается с 0.
display.println(«Hello world! 11111111»); // Печатаем 1 строку.
display.setCursor(0,10); // Устанавливаем курсор в колонку 0, строку 1.(строка №2 ).
display.println(«Dmitry OSIPOV 2222222»); // Печатаем 2 строку.
display.setTextSize(5); // Меняем размер текста (5).
display.setCursor(0,20); // Устанавливаем курсор в колонку 0, строку 2.(строка №3 ).
display.println(«Size»); // Печатаем 3 строку.
display.display(); // Чтобы сделать символы видимыми на дисплее !.
}
void loop() {
}
И вылезают следующие ошибки:
Arduino: 1.6.5 (Windows 8.1), Плата»Arduino Uno»ssd1306_128x64_i2c.ino: In function ‘void setup()’:
ssd1306_128x64_i2c:9: error: redefinition of ‘void setup()’
sketch_jun16b:1: error: ‘void setup()’ previously defined here
ssd1306_128x64_i2c.ino: In function ‘void loop()’:
ssd1306_128x64_i2c:23: error: redefinition of ‘void loop()’
sketch_jun16b:6: error: ‘void loop()’ previously defined here
redefinition of ‘void setup()’Можете подсказать, какие ошибки тут?
-
Такое ощущение, что в один проект попало два файла с исходным текстом, в которых присутствуют функции setup и loop.
Имеет смысл глянуть в папку со скетчем и посмотреть на предмет наличия в ней файлов
ssd1306_128x64_i2c.ino
и sketch_jun16b (расширение, скорее всего, тоже .ino).
Следует посмотреть, какой из них содержит нужный код и выкинуть второй (переместить в другую папку, если он все-таки нужен).Теряюсь в догадках, как такого можно случайно достичь.
-
Перезапустил программу, вбил код заново… и снова проблемы…
D:ArduinoScetcheslibrariesAdafruit_SSD1306Adafruit_SSD1306.cpp:433:6: error: prototype for ‘void Adafruit_SSD1306::dim(boolean)’ does not match any in class ‘Adafruit_SSD1306’
void Adafruit_SSD1306::dim(boolean dim) {
^
In file included from D:ArduinoScetcheslibrariesAdafruit_SSD1306Adafruit_SSD1306.cpp:28:0:
D:ArduinoScetcheslibrariesAdafruit_SSD1306Adafruit_SSD1306.h:152:8: error: candidate is: void Adafruit_SSD1306::dim(uint8_t)
void dim(uint8_t contrast);
^
Ошибка компиляции.
Эх, не получается у меня что-либо сделать без проблем..
-
Какое-то противоречие внутри библиотеки.
Если я ничего не путаю, то в заголовочном файле библиотеки функция описана одним образом, а в cpp другим. В результате при компиляции библиотеки в одном месте оно ругается, что не может найти в описании класса ничего похожего на то, что пытается определить в реализации, а при компиляции включаемого заголовочного файла ругается на то, что не может найти реализацию заявленной в определении класса функции.
А вся проблема в разном именовании типа параметра: boolean в одном месте и uint8_t в другом.
Можно попробовать скорректировать библиотеку, приведя описание функции к общему знаменателю, но тут нужно видеть всю библиотеку, чтобы попытаться определить, какой именно тип из двух нужен, и поможет ли исправление.
Возможно, более простым решением будет найти другую, рабочую библиотеку. -
-
Благодарю!
Библия с этого гайда таки завела экран.
А то я еще попробовал OzOLED библию, она вроде затекла на ардуину, но экран не включила. Уже подумал, что месяц с ебая ждал брак.
Большое спасибо всем ответившим.
💥 Arduino IDE ошибки компиляции скетча
Ошибки компиляции Arduino IDE возникают при проверке или загрузке скетча в плату, если код программы содержит ошибки, компилятор не может найти библиотеки или переменные. На самом деле, сообщение об ошибке при загрузке скетча связано с невнимательностью самого программиста. Рассмотрим в этой статье все возможные ошибки компиляции для платы Ардуино UNO R3, NANO, MEGA и пути их решения.
Ошибка компиляции для Arduino Nano, Uno, Mega
Самые простые ошибки возникают у новичков, кто только начинает разбираться с языком программирования Ардуино и делает первые попытки загрузить скетч. Если вы не нашли решение своей проблемы в статье, то напишите свой вопрос в комментариях к этой записи и мы поможем решить вашу проблему с загрузкой (бесплатно!).
Ошибка: avrdude: stk500_recv(): programmer is not responding
Что делать в этом случае? Первым делом обратите внимание какую плату вы используете и к какому порту она подключена (смотри на скриншоте в правом нижнем углу). Необходимо сообщить Arduino IDE, какая плата используется и к какому порту она подключена. Если вы загружаете скетч в Ардуино Nano V3, но при этом в настройках указана плата Uno или Mega 2560, то вы увидите ошибку, как на скриншоте ниже.
Ошибка Ардуино: programmer is not responding
Такая же ошибка будет возникать, если вы не укажите порт к которому подключена плата (это может быть любой COM-порт, кроме COM1). В обоих случаях вы получите сообщение — плата не отвечает ( programmer is not responding ). Для исправления ошибки надо на панели инструментов Arduino IDE в меню «Сервис» выбрать нужную плату и там же, через «Сервис» → «Последовательный порт» выбрать порт «COM7».
Ошибка: a function-definition is not allowed here before ‘<‘ token
Это значит, что в скетче вы забыли где-то закрыть фигурную скобку. Синтаксические ошибки IDE тоже распространены и связаны они просто с невнимательностью. Такие проблемы легко решаются, так как Arduino IDE даст вам подсказку, стараясь отметить номер строки, где обнаружена ошибка. На скриншоте видно, что строка с ошибкой подсвечена, а в нижнем левом углу приложения указан номер строки.
Ошибка: a function-definition is not allowed here before ‘<‘ token
Ошибка: expected initializer before ‘>’ token / expected ‘;’ before ‘>’ token
Сообщение expected initializer before ‘>’ token говорит о том, что вы, наоборот где-то забыли открыть фигурную скобку. Arduino IDE даст вам подсказку, но если скетч довольно большой, то вам придется набраться терпения, чтобы найти неточность в коде. Ошибка при компиляции программы: expected ‘;’ before ‘>’ token говорит о том, что вы забыли поставить точку с запятой в конце командной строки.
Ошибка: ‘ ‘ was not declared in this scope
Что за ошибка? Arduino IDE обнаружила в скетче слова, не являющиеся служебными или не были объявлены, как переменные. Например, вы забыли продекларировать переменную или задали переменную ‘DATA’, а затем по невнимательности используете ‘DAT’, которая не была продекларирована. Ошибка was not declared in this scope возникает при появлении в скетче случайных или лишних символов.
Ошибка Ардуино: was not declared in this scope
Например, на скриншоте выделено, что программист забыл продекларировать переменную ‘x’, а также неправильно написал функцию ‘analogRead’. Такая ошибка может возникнуть, если вы забудете поставить комментарий, написали функцию с ошибкой и т.д. Все ошибки также будут подсвечены, а при нескольких ошибках в скетче, сначала будет предложено исправить первую ошибку, расположенную выше.
Ошибка: No such file or directory / exit status 1
exit status 1 Ошибка компиляции для платы Arduino Nano
Довольно часто у новичков выходит exit status 1 ошибка компиляции для платы arduino/genuino uno. Причин данного сообщения при загрузке скетча в плату Arduino Mega или Uno может быть огромное множество. Но все их легко исправить, достаточно внимательно перепроверить код программы. Если в этом обзоре вы не нашли решение своей проблемы, то напишите свой вопрос в комментариях к этой статье.
Источник
Смурф
помогите,новичек в этом деле-
Arduino: 1.8.12 (Windows 10), Плата:»Arduino Nano, ATmega328P»
colorMusic_v2.10:195:10: fatal error: FHT.h: No such file or directory
#include // преобразование Хартли
exit status 1
FHT.h: No such file or directory
при прошивке выдает ошибку
viktor001
Trofim
Всем добрый вечер! Не могу установить задержку после налива, я в этом деле лошара(. Прописал как подсказали но выдаёт ошибку( Или еще надо где-то изменить?
Геннадий10
abrams3737
artyom
Wan-Derer
Смурф
abrams3737
Wan-Derer
boultonsrolf
Привет. Подскажите плиз в чем может быть проблема? 2-й день вожусь пробую разные варианты, но ошибки все те же.
pavelbdr
Доброго времени суток. Прошу помощи. При заливки прошивки в плату выскакивает ошибка
Arduino: 1.8.11 (Windows 10), Плата:»WeMos D1 R1, 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 921600″
In file included from sketchmicroLED.h:24:0,
from C:Program FilesArduinohardwareGyverStringOffline_v1.3GyverStringOffline_v1.3.ino:79:
sketchws2812_send.h: In function ‘void ws2812_sendarray_mask(uint16_t*, uint16_t, uint8_t, uint8_t*, uint8_t*, byte)’:
ws2812_send.h:110:12: error: ‘SREG’ was not declared in this scope
In file included from C:Program FilesArduinohardwareGyverStringOffline_v1.3GyverStringOffline_v1.3.ino:79:0:
sketchmicroLED.h: In constructor ‘microLED::microLED(LEDdata*, int, byte)’:
microLED.h:166:14: error: cannot convert ‘volatile uint32_t* ‘ to ‘const volatile uint8_t* ‘ in assignment
microLED.h:167:18: error: cannot convert ‘volatile uint32_t* ‘ to ‘volatile uint8_t* ‘ in assignment
sketchmicroLED.h: In constructor ‘microLED::microLED(LEDdata*, byte, byte, byte, M_type, M_connection, M_dir)’:
microLED.h:175:14: error: cannot convert ‘volatile uint32_t* ‘ to ‘const volatile uint8_t* ‘ in assignment
microLED.h:176:18: error: cannot convert ‘volatile uint32_t* ‘ to ‘volatile uint8_t* ‘ in assignment
exit status 1
‘SREG’ was not declared in this scope
Старик Похабыч
Craftim
Доброго времени суток форумчане. Попытался я залить прошивку для ардуины в nano и получил следующую ошибку.
‘class GButton’ has no member named ‘isHolded2’; did you mean ‘isHolded’?
Эдуард Анисимов
Craftim
Я не знаю))) Я как скачал, так и заливаю.
Поковырялся с библиотеками, скетч закомпилировался. но на ардуинку нано не встает, пишет памяти не хватает.
P.S. Подумал еще лучше и понял, что у меня не 328 чип.
Vpavava
Доброго времени суток. Прошу помощи! С ардуино общаюсь 1 раз, поэтому прошу сильно не бить. Собрал подсветку, все согласно схеме подключил, на этапе прошивки вылезают ошибки: 1)
Произошла ошибка при загрузке скетча
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xbe
avrdude: stk500_recv(): programmer is not responding
Переставил на old bootloader. Проблема решилась.
2)
Неверная библиотека найдена в C:Program Files (x86)ArduinolibrariesFastLED-master: нет заголовочных файлов (.h), найденных в C:Program Files (x86)ArduinolibrariesFastLED-master
И так с кучей других библиотек. Доблестно ползал по форуму, вчитываясь в подобные проблемы. Распихал библиотеки со всеми файлами по папкам-не помогло. Пожалуйста, разъясните, в чем может быть проблема?
Предыдущие проблемы удалось устранить самостоятельно. Теперь остались только неверные библиотеки и перед этим всем всплывает такое сообщение. Это нужно фиксить программно, или должно работать и так и я должен искать ошибку в схеме?
In file included from C:UsersBlack Jack RussiaDesktopArduino_Ambilight-masterGyver_AmbilightGyver_Ambilight.ino:25:0:
C:UsersBlack Jack RussiaDocumentsArduinolibrariesFastLED/FastLED.h:14:21: note: #pragma message: FastLED version 3.003.003
# pragma message «FastLED version 3.003.003»
Скетч использует 5730 байт (18%) памяти устройства. Всего доступно 30720 байт.
Глобальные переменные используют 565 байт (27%) динамической памяти, оставляя 1483 байт для локальных переменных. Максимум: 2048 байт.
Неверная библиотека найдена в C:UsersBlack Jack RussiaDocumentsArduinolibrariesdocs: нет заголовочных файлов (.h), найденных в C:UsersBlack Jack RussiaDocumentsArduinolibrariesdocs
Неверная библиотека найдена в C:UsersBlack Jack RussiaDocumentsArduinolibrariesexamples: нет заголовочных файлов (.h), найденных в C:UsersBlack Jack RussiaDocumentsArduinolibrariesexamples
Неверная библиотека найдена в C:UsersBlack Jack RussiaDocumentsArduinolibrariesextras: нет заголовочных файлов (.h), найденных в C:UsersBlack Jack RussiaDocumentsArduinolibrariesextras
Неверная библиотека найдена в C:UsersBlack Jack RussiaDocumentsArduinolibrariesplatforms: нет заголовочных файлов (.h), найденных в C:UsersBlack Jack RussiaDocumentsArduinolibrariesplatforms
Неверная библиотека найдена в C:UsersBlack Jack RussiaDocumentsArduinolibrariesdocs: нет заголовочных файлов (.h), найденных в C:UsersBlack Jack RussiaDocumentsArduinolibrariesdocs
Неверная библиотека найдена в C:UsersBlack Jack RussiaDocumentsArduinolibrariesexamples: нет заголовочных файлов (.h), найденных в C:UsersBlack Jack RussiaDocumentsArduinolibrariesexamples
Неверная библиотека найдена в C:UsersBlack Jack RussiaDocumentsArduinolibrariesextras: нет заголовочных файлов (.h), найденных в C:UsersBlack Jack RussiaDocumentsArduinolibrariesextras
Неверная библиотека найдена в C:UsersBlack Jack RussiaDocumentsArduinolibrariesplatforms: нет заголовочных файлов (.h), найденных в C:UsersBlack Jack RussiaDocumentsArduinolibrariesplatforms
Источник
Arduino.ru
exit status 1 Ошибка компиляции для платы Arduino Nano.Задолбало
Исправил пишет : Arduino: 1.8.1 (Windows 7), Плата:»Arduino Nano, ATmega328″
Исправил пишет : Arduino: 1.8.1 (Windows 7), Плата:»Arduino Nano, ATmega328″
Вам четко пишет: не найдена библиотека Ucglib.h. т.к в исходном скетче она была указана в кавычках, то ожидалось наличие этой библиотеки в каталоге с Вашим скетчем. Если ее там не находит, то, очевидно, Вы не все стянули вместе со скетчем.
Альтернативный путь: установить библиотеку (скачать и установить) и указать #include
В любом случае, где-то, по доступным IDE путям, библиотека должна быть.
UPD: Хотя я надеялся, что она у Вас есть в каталоге: C:PF(x86)Arduinolibrariesucglib-master
В скетче правильно прописано, только закиньте эту библиотеку (два файла) в папку со скетчем
C:Program Files (x86)ArduinolibrariesUcglib
А где должен находиться ваш скетч? Почитайтьте документацию хотя бы! В папке с программой его быть не должно!
На фонт ругается, значит в библиотеке его нет
К сожалению я с этими библиотеками не работал, где находятся фонты не знаю
Открыл пример и созерцаю ))) А у вас какой дисплей применяется
В C:Program FilesArduinolibraries вообще не лезьте. Ни в коем случае не нужно дублировать библиотеки в двух местах. Удалите оттуда всё, что сами добавили.
еще раз! я спросил какой дисплей вы применяете
PS а какой у тех, у кого работает?
В C:Program FilesArduinolibraries вообще не лезьте. Ни в коем случае не нужно дублировать библиотеки в двух местах. Удалите оттуда всё, что сами добавили.
Дисплей 1.8 SPI 128X160
Дайте ссылку на то, что вы скачали.
Приведите настройки этого пробного скетча для вашего дисплея
Дайте ссылку на то, что вы скачали.
P.S. Проверил, у меня всё скомпилировалось (Arduino IDE 1.6.13):
Скетч использует 18 472 байт (60%) памяти устройства. Всего доступно 30 720 байт. Глобальные переменные используют 1 064 байт (51%) динамической памяти, оставляя 984 байт для локальных переменных. Максимум: 2 048 байт.
Источник
Неверная библиотека найдена arduino как исправить
АХТУНГ!
Вставка от модератора:
Подробное руководство по загрузке прошивки в Ардуино от Алекса Гайвера:
Прежде чем строчить сообщения, внимательно ознакомьтесь.
Здраствуйте, у меня возникла ошибка с компиляцией скетча, всё сделал по инструкции, несколько раз всё перепроверил, но всё равно возникает ошибка
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
^
compilation terminated.
Ошибка компиляции.
Viceroy
Виталий550
b_mixail
Нужна помощь, скетч «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’
CUBE_Gyver_v2:149:13: error: ‘class GButton’ has no member named ‘isClick’
CUBE_Gyver_v2:155:13: error: ‘class GButton’ has no member named ‘isStep’
CUBE_Gyver_v2:158:13: error: ‘class GButton’ has no member named ‘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’
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’
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’
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’
C:Program Files (x86)ArduinolibrariesGyverHacksGyverHacks.cpp:326:1: error: prototype for ‘GTimer::GTimer(uint16_t)’ does not match any in class ‘GTimer’
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&&)
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()
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.
Александр Симонов
b_mixail
Взял все три библиотеки оттуда (GyverButton, GyverHacks, GyverTimer).
VIt-Wap
Доброго дня. ничего не могу сделать. При компиляции выдает ошибку
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
Александр Симонов
VIt-Wap
lylyk
Создала проект, сейчас компилятор выводит ошибку. Помогите пожалуйста с этой проблемой, я новенькая в этом деле..
Вот:
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 for instructions.
lto-wrapper.exe: fatal error: C:Program FilesWindowsAppsArduinoLLC.ArduinoIDE_1.8.19.0_x86__mdqgnx93n4wtthardwaretoolsavr/bin/avr-gcc returned 1 exit status
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.
Александр Симонов
Александр Симонов
be3um4wka
Александр Симонов
be3um4wka
cg_spooler
В версии 1.3 ошибка fillAll что конкретно правилось? по поиску исправлений не нашёл.
Вложения
pavel lolkek
colorMusic_v2.9.ino:195:50: fatal error: FHT.h: No such file or directory
compilation terminated.
Ошибка компиляции.
johnny0007
pavel lolkek
Выбранная папка/zip файл не содержит корректных библиотек
Неверная библиотека найдена в C:UsersuserDocumentsArduinolibrariesColorMusic-master: нет заголовочных файлов (.h), найденных в C:UsersuserDocumentsArduinolibrariesColorMusic-master
Максим3704
Duzer
@Максим3704, либо не та библиотека для датчика температуры. Либо не там лежит. У меня лежит в папке /мои документы /arduino ide /libraries
Библиотеки отличаются для одних и тех же датчиков. Сам перебрал кучу, пока нашёл нужную
be3um4wka
Wan-Derer
sonykkk
Arduino: 1.6.5 (Windows 7), Плата»Arduino Nano, ATmega328″
Источник
-
#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.
Ошибка компиляции.
Изменено: 19 Мар 2020
-
#2
Написано же четко.
fatal error: Wire.h: No such file or directory
#include <Wire.h>
библеотека Wire.h — Данный файл или каталог отсутствует
-
#3
Не могу запрограммировать Arduino. Не было под рукой всех нужных деталей,поэтому сделал на микрофоне,который Алекс НЕ советовал,но вариантов не было. Суть не в этом. Вылезает ошибка компиляции. Библиотеки заново копировал по нескольку раз и не помогает. С проектом Ambilight тоже была такая же проблема. Не мог найти какой-то файл. Что делать?
-
#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 и установить её.
-
#13
Здравствуйте. Помогите пожалуйста! Хотел собрать в первый раз что-то на ардуино, решил сделать bluetooth матрицу с часами, но на плату не ставится код. Места хватает и драва под плату установил, проблема в чём-то другом. Заранее спасибо…
P.S. Плата не оригинальная. Заказывал с али. Её название: WAVGAT UNO R3.
-
#14
Какую конкретно ошибку выдает Arduino IDE при загрузке скетча?
-
#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
-
#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.
Ошибка компиляции.
-
#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
Библиотеки отличаются для одних и тех же датчиков. Сам перебрал кучу, пока нашёл нужную
-
#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
-
#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
Это сообщение будет содержать больше информации чем
«Отображать вывод во время компиляции»
включено в Файл > Настройки
Я пишу код для своих классов и у меня есть ошибка, с которой я не могу справиться. Ошибки заключаются в следующем. Также я не могу ничего менять в основном файле:
In file included from lab13.cpp:15:0:
lab13.h: In member function ‘TSeries& TSeries::operator()(int, int)’:
lab13.h:10:39: warning: no return statement in function returning non-void [-Wreturn-type]
TSeries &operator()(int, int){}
^
g++ -c -Wall lab13f.cpp
In file included from lab13f.cpp:1:0:
lab13.h:15:10: error: ‘ostream’ in namespace ‘std’ does not name a type
friend std::ostream &operator<<(std::ostream &o,const TSeries &ts);
^
lab13.h: In member function ‘TSeries& TSeries::operator()(int, int)’:
lab13.h:10:39: warning: no return statement in function returning non-void [-Wreturn-type]
TSeries &operator()(int, int){}
^
lab13f.cpp: At global scope:
lab13f.cpp:13:9: error: prototype for ‘TSeries TSeries::operator()(int, int)’ does not match any in class ‘TSeries’
TSeries TSeries::operator()(int, int){}
^
In file included from lab13f.cpp:1:0:
lab13.h:10:18: error: candidate is: TSeries& TSeries::operator()(int, int)
TSeries &operator()(int, int){}
^
lab13f.cpp:16:9: error: prototype for ‘TSeries TSeries::operator+(TSeries&)’ does not match any in class ‘TSeries’
TSeries TSeries::operator+(TSeries &ts){
^
In file included from lab13f.cpp:1:0:
lab13.h:9:17: error: candidate is: const TSeries TSeries::operator+(const TSeries&) const
const TSeries operator+(const TSeries &ts)const;
^
lab13f.cpp:45:19: error: definition of implicitly-declared ‘TSeries::~TSeries()’
TSeries::~TSeries(){}
^
lab13f.cpp: In member function ‘TSeries& TSeries::operator=(TSeries (*)(int, int))’:
lab13f.cpp:47:52: warning: no return statement in function returning non-void [-Wreturn-type]
TSeries &TSeries::operator=(TSeries(int a, int b)){}
^
lab13f.cpp: In function ‘std::ostream& operator<<(std::ostream&, const TSeries&)’:
lab13f.cpp:51:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
make: *** [lab13f.o] Błąd 1
Я потратил пару дней, пытаясь решить проблему, и наконец сдался. Надеюсь, кто-нибудь поможет мне в моей борьбе 🙂 Я был бы очень благодарен.
Я забыл добавить, что основной файл был написан преподавателем, и ни при каких обстоятельствах мне не разрешено изменять НИЧЕГО в нем.
0
Решение
Линия
TSeries &operator=(TSeries(int a, int b));
объявляет функцию, аргумент которой является функцией с двумя входами типа int
и тип возвращаемого значения TSeries
,
Я не думаю, что ты хотел это сделать.
Оператор присваивания копии будет объявлен с синтаксисом:
TSeries &operator=(TSeries const& rhs);
Также не понятно, что вы имели в виду в строке:
TSeries series4=series1(2,4);
Возможно, вы хотели использовать:
// Will use the compiler generated copy constructor
// since you haven't declared one.
TSeries series4=series1;
или же
// Will use the constructor that takes two ints
TSeries series4(2,4);
1
Другие решения
Может быть, это опечатка. Это:
TSeries series4=series1(2,4);
не создает series4
с аргументами конструктора 2
а также 4
, но вместо этого он пытается позвонить series1
‘s (ПРИМЕЧАНИЕ: это переменная) operator()(int, int)
, И такого оператора не определено.
Я думаю тебе нужно
TSeries series4=TSeries(2,4);
Или даже лучше:
TSeries series4(2,4);
Кроме того, конструкции, как это:
series1+=1.,0.,3.;
на самом деле позвонит operator +=
только однажды. Просто чтобы быть ясно, так как я не уверен, ожидаете ли вы этого. Вы можете прочитать о operator,
в C ++.
Итак, если вы хотите 3 дополнения, вам нужно:
series1+=1.;
series1+=0.;
series1+=3.;
Также обратите внимание на ответ @ RSahu о operator=
, за что я проголосовал (хороший улов, я этого не заметил).
1
Компилятор жалуется, потому что series1 (2,4) вызывает TSeries :: operator () (int, int), который отсутствует, а не конструктор TSeries (int, int)
0
Непонятные ошибки. Класс «Список»
21.05.2015, 15:47. Показов 2843. Ответов 6
C++ | ||
|
C++ | ||
|
Добавлено через 1 минуту
Ошибки:
In file included from D:c++listtest.cpp:3:0:
D:c++listlist.h: In instantiation of ‘my::List<Type>::List() [with Type = int]’:
D:c++listtest.cpp:9:15: required from here
D:c++listlist.h:51:67: error: no matching function for call to ‘my::List<int>::Elem::Elem(std::nullptr_t)’
List<Type>::List() : _begin(nullptr), _back(nullptr), length(0)
^
D:c++listlist.h:51:67: note: candidates are:
D:c++listlist.h:24:17: note: my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = int]
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:24:17: note: no known conversion for argument 1 from ‘std::nullptr_t’ to ‘const int&’
D:c++listlist.h:21:20: note: constexpr my::List<int>::Elem::Elem(const my::List<int>::Elem&)
struct Elem
^
D:c++listlist.h:21:20: note: no known conversion for argument 1 from ‘std::nullptr_t’ to ‘const my::List<int>::Elem&’
D:c++listlist.h:21:20: note: constexpr my::List<int>::Elem::Elem(my::List<int>::Elem&&)
D:c++listlist.h:21:20: note: no known conversion for argument 1 from ‘std::nullptr_t’ to ‘my::List<int>::Elem&&’
D:c++listlist.h: In instantiation of ‘my::List<Type>::~List() [with Type = int]’:
D:c++listtest.cpp:9:15: required from here
D:c++listlist.h:74:35: error: no matching function for call to ‘my::List<int>::Elem::Elem()’
for (Elem* temp = _begin, next_t; temp != _back; temp = next_t){
^
D:c++listlist.h:74:35: note: candidates are:
D:c++listlist.h:24:17: note: my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = int]
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:24:17: note: candidate expects 2 arguments, 0 provided
D:c++listlist.h:21:20: note: constexpr my::List<int>::Elem::Elem(const my::List<int>::Elem&)
struct Elem
^
D:c++listlist.h:21:20: note: candidate expects 1 argument, 0 provided
D:c++listlist.h:21:20: note: constexpr my::List<int>::Elem::Elem(my::List<int>::Elem&&)
D:c++listlist.h:21:20: note: candidate expects 1 argument, 0 provided
D:c++listlist.h:74:48: error: no match for ‘operator!=’ (operand types are ‘my::List<int>::Elem*’ and ‘my::List<int>::Elem’)
for (Elem* temp = _begin, next_t; temp != _back; temp = next_t){
^
D:c++listlist.h:74:63: error: cannot convert ‘my::List<int>::Elem’ to ‘my::List<int>::Elem*’ in assignment
for (Elem* temp = _begin, next_t; temp != _back; temp = next_t){
^
D:c++listlist.h:75:20: error: invalid user-defined conversion from ‘my::List<int>::Elem*’ to ‘my::List<int>::Elem&&’ [-fpermissive]
next_t = temp->next;
^
D:c++listlist.h:24:17: note: candidate is: my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = int] <near match>
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:24:17: note: no known conversion for argument 1 from ‘my::List<int>::Elem*’ to ‘const int&’
D:c++listlist.h:75:20: error: invalid conversion from ‘my::List<int>::Elem*’ to ‘const int&’ [-fpermissive]
next_t = temp->next;
^
D:c++listlist.h:24:17: error: initializing argument 1 of ‘my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = int]’ [-fpermissive]
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:75:20: error: conversion to non-const reference type ‘struct my::List<int>::Elem&&’ from rvalue of type ‘my::List<int>::Elem’ [-fpermissive]
next_t = temp->next;
^
D:c++listlist.h:79:9: error: type ‘struct my::List<int>::Elem’ argument given to ‘delete’, expected pointer
delete _back;
^
D:c++listlist.h: In instantiation of ‘my::List<Type>::List(const Type&, my::size_type) [with Type = int; my::size_type = long long unsigned int]’:
D:c++listtest.cpp:10:21: required from here
D:c++listlist.h:56:66: error: no matching function for call to ‘my::List<int>::Elem::Elem()’
List<Type>::List(const Type& obj, size_type num) : length(num)
^
D:c++listlist.h:56:66: note: candidates are:
D:c++listlist.h:24:17: note: my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = int]
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:24:17: note: candidate expects 2 arguments, 0 provided
D:c++listlist.h:21:20: note: constexpr my::List<int>::Elem::Elem(const my::List<int>::Elem&)
struct Elem
^
D:c++listlist.h:21:20: note: candidate expects 1 argument, 0 provided
D:c++listlist.h:21:20: note: constexpr my::List<int>::Elem::Elem(my::List<int>::Elem&&)
D:c++listlist.h:21:20: note: candidate expects 1 argument, 0 provided
D:c++listlist.h:61:24: error: invalid user-defined conversion from ‘my::List<int>::Elem*’ to ‘my::List<int>::Elem&&’ [-fpermissive]
_begin = _back = new Elem(obj); // Первый элемент
^
D:c++listlist.h:24:17: note: candidate is: my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = int] <near match>
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:24:17: note: no known conversion for argument 1 from ‘my::List<int>::Elem*’ to ‘const int&’
D:c++listlist.h:61:24: error: invalid conversion from ‘my::List<int>::Elem*’ to ‘const int&’ [-fpermissive]
_begin = _back = new Elem(obj); // Первый элемент
^
D:c++listlist.h:24:17: error: initializing argument 1 of ‘my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = int]’ [-fpermissive]
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:61:24: error: conversion to non-const reference type ‘struct my::List<int>::Elem&&’ from rvalue of type ‘my::List<int>::Elem’ [-fpermissive]
_begin = _back = new Elem(obj); // Первый элемент
^
D:c++listlist.h:61:16: error: cannot convert ‘my::List<int>::Elem’ to ‘my::List<int>::Elem*’ in assignment
_begin = _back = new Elem(obj); // Первый элемент
^
D:c++listlist.h:66:18: error: base operand of ‘->’ has non-pointer type ‘my::List<int>::Elem’
_back->next = temp;
^
D:c++listlist.h:67:19: error: invalid user-defined conversion from ‘my::List<int>::Elem*’ to ‘my::List<int>::Elem&&’ [-fpermissive]
_back = temp;
^
D:c++listlist.h:24:17: note: candidate is: my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = int] <near match>
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:24:17: note: no known conversion for argument 1 from ‘my::List<int>::Elem*’ to ‘const int&’
D:c++listlist.h:67:19: error: invalid conversion from ‘my::List<int>::Elem*’ to ‘const int&’ [-fpermissive]
_back = temp;
^
D:c++listlist.h:24:17: error: initializing argument 1 of ‘my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = int]’ [-fpermissive]
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:67:19: error: conversion to non-const reference type ‘struct my::List<int>::Elem&&’ from rvalue of type ‘my::List<int>::Elem’ [-fpermissive]
_back = temp;
^
D:c++listlist.h: In instantiation of ‘my::List<Type>::List(const Type&, my::size_type) [with Type = char; my::size_type = long long unsigned int]’:
D:c++listtest.cpp:11:28: required from here
D:c++listlist.h:56:66: error: no matching function for call to ‘my::List<char>::Elem::Elem()’
List<Type>::List(const Type& obj, size_type num) : length(num)
^
D:c++listlist.h:56:66: note: candidates are:
D:c++listlist.h:24:17: note: my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = char]
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:24:17: note: candidate expects 2 arguments, 0 provided
D:c++listlist.h:21:20: note: constexpr my::List<char>::Elem::Elem(const my::List<char>::Elem&)
struct Elem
^
D:c++listlist.h:21:20: note: candidate expects 1 argument, 0 provided
D:c++listlist.h:21:20: note: constexpr my::List<char>::Elem::Elem(my::List<char>::Elem&&)
D:c++listlist.h:21:20: note: candidate expects 1 argument, 0 provided
D:c++listlist.h:61:24: error: invalid user-defined conversion from ‘my::List<char>::Elem*’ to ‘my::List<char>::Elem&&’ [-fpermissive]
_begin = _back = new Elem(obj); // Первый элемент
^
D:c++listlist.h:24:17: note: candidate is: my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = char] <near match>
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:24:17: note: no known conversion for argument 1 from ‘my::List<char>::Elem*’ to ‘const char&’
D:c++listlist.h:61:24: error: invalid conversion from ‘my::List<char>::Elem*’ to ‘const char&’ [-fpermissive]
_begin = _back = new Elem(obj); // Первый элемент
^
D:c++listlist.h:24:17: error: initializing argument 1 of ‘my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = char]’ [-fpermissive]
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:61:24: error: conversion to non-const reference type ‘struct my::List<char>::Elem&&’ from rvalue of type ‘my::List<char>::Elem’ [-fpermissive]
_begin = _back = new Elem(obj); // Первый элемент
^
D:c++listlist.h:61:16: error: cannot convert ‘my::List<char>::Elem’ to ‘my::List<char>::Elem*’ in assignment
_begin = _back = new Elem(obj); // Первый элемент
^
D:c++listlist.h:66:18: error: base operand of ‘->’ has non-pointer type ‘my::List<char>::Elem’
_back->next = temp;
^
D:c++listlist.h:67:19: error: invalid user-defined conversion from ‘my::List<char>::Elem*’ to ‘my::List<char>::Elem&&’ [-fpermissive]
_back = temp;
^
D:c++listlist.h:24:17: note: candidate is: my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = char] <near match>
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:24:17: note: no known conversion for argument 1 from ‘my::List<char>::Elem*’ to ‘const char&’
D:c++listlist.h:67:19: error: invalid conversion from ‘my::List<char>::Elem*’ to ‘const char&’ [-fpermissive]
_back = temp;
^
D:c++listlist.h:24:17: error: initializing argument 1 of ‘my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = char]’ [-fpermissive]
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
D:c++listlist.h:67:19: error: conversion to non-const reference type ‘struct my::List<char>::Elem&&’ from rvalue of type ‘my::List<char>::Elem’ [-fpermissive]
_back = temp;
^
D:c++listlist.h: In instantiation of ‘my::List<Type>::~List() [with Type = char]’:
D:c++listtest.cpp:11:28: required from here
D:c++listlist.h:74:35: error: no matching function for call to ‘my::List<char>::Elem::Elem()’
for (Elem* temp = _begin, next_t; temp != _back; temp = next_t){
^
D:c++listlist.h:74:35: note: candidates are:
D:c++listlist.h:24:17: note: my::List<Type>::Elem::Elem(const Type&, my::List<Type>::Elem*) [with Type = char]
Elem(const Type& obj1, Elem* ptr = nullptr) : obj(obj1), next(ptr){}
^
__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь
0
Ok, I’m terrible at programming. I’ve been reading the two textbooks I have and I feel like I’m getting dumber and dumber. All that being said, I could use some help. The instructions for my program are incredibly vague for the most part. So here’s my instructions:
Design a class called Date that has data members to store month, day, and year. The class should have a default constructor and a three-parameter constructor that allows the date to be set at the time a new Date object is created. If the user creates a Date object without passing any arguments, or if any of the values passed are invalid, the default values of 1, 1, 2001 (i.e., January 1, 2001) should be used. Be sure your program only accepts reasonable values for month, day, and year. The day should be between 1 and the number of days in the selected month.
Alright, so what this doesn’t mention is that I have to have a .h file for the class, and two .cpp files, one for my main and one for my functions. I have set up all three files and I was told my class was set up correctly. So I guess at the moment I’m having trouble with connecting the three files. I’m getting these errors that I don’t know how to fix. It’s probably easy but again, i’m terrible at this stuff. So here’s my errors:
date.cpp:27: error: ISO C++ forbids declaration of ‘get_date’ with no type date.cpp:27: error: prototype for ‘int date::get_date(int, int, int)’ does not match any in class ‘date’ ./date.h:28: error: candidate is: void date::get_date(int, int, int) main.cpp: In function ‘int main()’: main.cpp:22: error: expected unqualified-id before ‘.’ token
And here’s my files:
date.h
|
|
date.cpp
|
|
main.cpp
|
|
I’m truly trying to understand this stuff so if there’s anything at all someone can tell me to let me know what/why what I’ve done is wrong and any suggestions about how I might want to go about completing this code will be greatly appreciated. I must enforce that I don’t expect to have any code written for me. Examples about things could be helpful. Mostly I just want to understand. All help is greatly appreciated.
**EDIT**
I just realized the line numbers aren’t going to be correct because of how I copy and pasted. I hope this makes sense: date.cpp line 27 is the date::get_date( int m, int d, int y ). date.h line 28 is the void get_date(int, int, int). main.cpp line 22 is the date.date(m, d, y). Obviously my get date functions are messed up, I just don’t know how.
Last edited on
In Date.cpp you forgot the get_date function return value
|
|
It must be like this.
In main
this line means nothing. You should declare an object of date type
When you define the member functions you have to mention the return type.
|
|
ohh, for that date.date() part. I thought I had declared an object of date type. Guess not. What would be the proper way to declare that then?
You define a date object like this:
date myDate(1,15,2015);
This creates a object called myDate and calls date::date(1,15,2015)
to initialize it.
Your methods inside date should be declared differently. For example, get_date() doesn’t need to take any parameters since it’s job is to prompt the user for the month, day and year, and assign the values to the object. Also, there’s no reason to call it get_date() when get() will do. To see this, consider how you’d call it:
|
|
You know from the declaration that myDate is a date, so having all the methods include _date in the name is redundant. It’s much more natural to write:
|
|
So class date should be declared like this:
|
|
There seems to still be something wrong with the main.cpp code. I made the suggested changes and that definitely helped, and makes sense (thank you for that) but now the error says:
main.cpp: In function ‘int main()’: main.cpp:21: error: no matching function for call to ‘date::get()’ ./date.h:28: note: candidates are: void date::get(int, int, int) main.cpp:23: error: no matching function for call to ‘date::check()’ ./date.h:29: note: candidates are: bool date::check(int, int, int) main.cpp:26: error: no matching function for call to ‘date::print()’ ./date.h:30: note: candidates are: int date::print(int, int, int)
The only thing I changed in the .h file was removing the unnecessary _date from the names and I made sure I took that out everywhere.
Looks like you still has not removed the function parameters from date.h.
date.cpp:27: error: ISO C++ forbids declaration of ‘get_date’ with no type date.cpp:27: error: prototype for ‘int date::get_date(int, int, int)’ does not match any in class ‘date’
./date.h:28: error: candidate is: void date::get_date(int, int, int)
when you define a member function from a class to outside the class or different file
you should include its type
|
|
main.cpp: In function ‘int main()’: main.cpp:22: error: expected unqualified-id before ‘.’ token
|
|
you cannot call the constructor like that you should instantiate or create an object of that class first.
|
|
or you can also do date(m,d,y) , example:
|
|
Last edited on
main.cpp: In function ‘int main()’: main.cpp:21: error: no matching function for call to ‘date::get()’ ./date.h:28: note: candidates are: void date::get(int, int, int) main.cpp:23: error: no matching function for call to ‘date::check()’ ./date.h:29: note: candidates are: bool date::check(int, int, int) main.cpp:26: error: no matching function for call to ‘date::print()’ ./date.h:30: note: candidates are: int date::print(int, int, int)
this error appears because you dont have print(),check(),get() with void(empty) parameter that you are defining.
you should specify its parameter too when defining member functions
Last edited on
Hmm, sorry, I think I’m getting more confused. I’ve also messed around with my code so much that I may have made it worse. So peter also mentioned making my parameters empty. I’ve emptied them now, not sure if I emptied them in the right places or not. Here’s what I have now:
.h
|
|
functions
|
|
main
|
|
oh, and you said I should specify the parameters when defining the functions. Do mean in my .h file or the function file. I’ve become so used to needing the parameters in functions and function calls that I think I’m confused about when/where to have or not parameters when dealing with these classes. Thank you for all your help by the way.
@brosephius
have you read about functions? prototype(declaration) and definitions?
http://www.cplusplus.com/doc/tutorial/functions/
I've become so used to needing the parameters in functions and function calls that I think I'm confused about when/where to have or not parameters when dealing with these classes.
dont confuse, the member function of your class (e.g function inside your class) is the prototype of the function and the definition is when you already write a body of that function
and you said I should specify the parameters when defining the functions.
if you are declaring it as empty function
|
|
[/code]
you should also define it as an empty function
|
|
same goes for your constructor
|
|
Last edited on
Ok, so I actually don’t need parameters anywhere then. How then do I pass values/references amongst the functions. Or do I not need to because the functions are all part of the same class and they return some value?
. How then do I pass values/references amongst the functions.
if you want that, then declare the functions with parameter/s
|
|
change your code into this
|
|
Or do I not need to because the functions are all part of the same class and they return some value?
the one advantage of class is you can easily manipulate the data members(variables)
in the class by accessing them from member functions ( so yes you can access the variables direclty from member functions)
example:
your print function
|
|
PS:
dont pass if you dont need to.
Last edited on