Questions tagged [compilation-errors]

An error that is generated during the compilation phase, often due to problems with invalid syntax and/or types. Not for errors during the uploading or execution phase.

Filter by
Sorted by
Tagged with
0
votes
0answers
17 views

expected unqualified-id before ‘if’ Error In My Code [closed]

I'm Trying To Write A Text Based Game With Desishen But The First if { Has The expected unqualified-id before ‘if’ Error Here's The Link To The Code Please Help Me. https://onlinegdb.com/B1l6kSwiIO ...
1
vote
1answer
43 views

Unable to compile c++11 libraries despite having added -std=c++11 in platform.txt

I want to use c++ data structures such as vectors, arrays, map... in my Arduino sketch. I made sure to add -std=c++11 and -std=gnu++11 in platform.txt, I am still getting the following error message: ...
0
votes
0answers
38 views

Connecting MPU6050 to Arduino Due but using Jeff Rowbergs Library

I am working on a personal project in which I need to collect accurate data from the MPU6050 using an Arduino Due. I can interface and read data from the MPU using the SLC and SDA pins and the "...
3
votes
1answer
268 views

How to enable exception handling on the Arduino Due?

While the question here gives some hints, the solution provided there does not directly work on the Due, since it uses a different compiler and toolkit. Also, the Due has more than enough flash for ...
0
votes
3answers
143 views

Returning struct from function generates 'does not name a type' compilation error

I have a main.ino file that contains struct EulerAngles { double roll, pitch, yaw; }; void setup() { EulerAngles angles; angles = anglesCalc(); Serial.print(angles.yaw); } void loop() { ...
0
votes
1answer
149 views

Why am I getting a “SendCommand was not declared” Error

#include <Adafruit_Fingerprint.h> #include <SoftwareSerial.h> #include <LiquidCrystal.h> uint8_t id; int getFingerprintIDez(); //pin #16 is IN from sensor (GREEN wire) //pin #15 is ...
-1
votes
1answer
38 views

I get an error?

void setup() { Serial.begin(9600); pinMode(13,OUTPUT); } void loop() { if(Serial.available()>0) {s_num =Serial.read();} if(s_num=='0'){ digitalWrite(13,HIGH); delay(100); //the specified time for 0 ...
0
votes
1answer
132 views

Arduino expected ')' before '{' token

for (byte i = 0; i < mfrc522.uid.size; i++) { Serial.print(mfrc522.uid.uidByte{i} < 0x10 ? " 0" : " "); Serial.print(mfrc522.uid.uidByte{i}, HEX); content....
2
votes
1answer
306 views

Own type definition using a struct does not name a type

I need to initialize several buttons and LEDs connected to my Arduino. To store data related to an individual button or LED, I decided to define my own data type using two different structs. One for a ...
1
vote
0answers
56 views

Error compiling for board NodeMCU 1.0

i tried compiling a program to upload sensor readings that i connected with my ESP8266 to cloud (in my case, Antares) but i keep getting this error message. Can anyone tell me where the problem is, ...
2
votes
1answer
79 views

utility/spi_com.h error when compiling Marlin for Arduino mega with Ramps 1.4

I am using win 8.1 and trying to load Marlin 2.0.x onto Arduino Mega with an attached Ramps 1.4 board fitted with 3 8825 Drivers. Unfortunately everytime I try to compile It concludes with the ...
-1
votes
1answer
53 views

How do I fix my code on the Arduino IDE App?

//www.elegoo.com #include <RobotIRremote.h> #define RECV_PIN 12 //Infrared signal receiving pin #define LED 13 //define LED pin #define L 16738455 #define ...
1
vote
1answer
63 views

Error message - Need help

I found this Haptic Headband project on YouTube (link below) and I am trying to verify the code that was given in the instructions with the Arduino IDE. However, I keep getting the message below and ...
1
vote
0answers
38 views

Error compiling to ESP32 using Arduino: Operand 2 of 'l32r' has out of range value

I was trying to follow this tutorial and ran into a problem compiling on the Arduino IDE with an ESP32 board. https://eloquentarduino.github.io/2019/12/how-to-do-gesture-identification-on-arduino/ I ...
0
votes
1answer
53 views

How to capture the compilaton output to a text file in Windows?

I am trying to capture the verbose output of the compilation to get it into a text file. I am using the IDE 1.8.12 running on Windows 10. I have tried looking for a right mouse button context menu, ...
1
vote
1answer
33 views

I am getting an error while trying to set up the U8g2 library

I am just trying to set up the U8g2 library to use an OLED. I read through the documentation and tried copying and pasting the code block example for the constructor, but switched out their ...
0
votes
0answers
129 views

Error compiling for board Arduino Mega or Mega 2560

#include <Servo.h> // Include Servo Library #include <NewPing.h> // Include Newping Library #include<SoftwareSerial.h> #include <dht.h> //Include the DHT library ...
-1
votes
1answer
119 views

Function 'backward' was not declared in this scope (error message) [closed]

Code: #include <SoftwareSerial.h> SoftwareSerial BTSerial(10, 11); // CONNECT BT RX PIN TO ARDUINO 11 PIN | CONNECT BT TX PIN TO ARDUINO 10 PIN char tiltDirection; int motorInput1 = 2; int ...
0
votes
0answers
29 views

Why does this code only compile when moving the setup() function or using an older Arduino IDE? [duplicate]

The following code does not compile using Arduino 1.8.13: void setup() {} template<typename T,size_t N> struct foo { T t[N]; }; void ok() { foo<int,1> var; } void notOK( foo<...
1
vote
1answer
543 views

error at compiling : 'class TwoWire' has no member named 'setClock'

I am a newbie C programmer and I just started with Arduino web editor (Win10-Firefox)to code for a Raspberry Pi (3B) board. RPi is on line via ethernet connection. I tried to compile an example from ...
0
votes
1answer
43 views

trying to make wemos d1 code modular causes collect2: error: ld returned 1 exit status exit status 1

#include "connection.h" void setup() { Serial.begin(115200); Funcs::Connect conn; conn.connectWifi(); } void loop() { } then connection.h file: // connection.h namespace Funcs { class ...
0
votes
1answer
70 views

pubsubclient won't compile in Arduino and VSCode IDEs

I've compiled successfully a year ago in Arduino IDE, but lately I'm getting fatal errors: /Users/davidjeffers/Documents/Arduino/libraries/PubSubClient/src/PubSubClient.cpp: At global scope: /Users/...
0
votes
1answer
71 views

Esp8266: Linux - fatal: No names found and undefined reference to `app_entry_custom()'

as Gentoo user I build everything from sources, but I have problem with building toolchain for esp8266. I came up with this script: #!/bin/sh # note: eselect python2 before, because of gcc # ...
0
votes
1answer
155 views

Error compiling for board Arduino Uno

I am relatively new to Arduino and I am trying to code some neo pixels and every time I try to verify my code this error comes up: Arduino: 1.8.12 (Mac OS X), Board: "Arduino Uno" loading ...
0
votes
2answers
606 views

Error compiling for board Arduino Nano

I have multiple Arduino Nano boards. I am able to compile or upload code only once. If I try to compile/upload again I get an error: "Error compiling for board Arduino Nano". However there is a ...
0
votes
1answer
139 views

I have a question,an error occured in my code saying TIMSK was not declared in the scope(There are no errors)

#include <SmartInventor.h> void setup() { SmartInventor.DCMotorUse(); } void loop() { // M1, M2, M3 // CW, CCW, STOP // 0-100 // 0-360 SmartInventor.DCMotor(M1, CW, 10); delay(...
0
votes
1answer
79 views

when i finished coding my 3 dc motors, all these errors accrued one said stray '/302' in the program [closed]

/* #include <SmartInventor.h> */ void setup() { SmartInventor.DCMotor(); } void loop() { // M1, M2, M3 // CW, CCW, STOP // 0-100 // 0-360 SmartInventor.DCMotor(M1, CW, 10, 45°);...
-2
votes
1answer
685 views

Having issue with a redeclaration as a different kind of symbol

Been struggling with this for a few days and I suspect that i have several issues but I cannot find them. Project: Need a serial count that counts by 5-50 and a button interrupt should trigger a ...
0
votes
1answer
33 views

Matching incoming data with a variable

I have a system where an RFID tag can be checked and Its individual 4byte UID will be printed. My task is to check if subsequent tags have the same UID and if not, print “access denied”. I'm assuming ...
1
vote
0answers
243 views

Error compiling for board Arduino Nano 33 BLE

I am trying to use pulse sensor with Arduino Nano 33 BLE sense, but when I verify it, it shows Error compiling for board Arduino Nano 33 BLE. The code is from the pulse sensor website. The code works ...
0
votes
1answer
31 views

Exit status 1 can't compile [closed]

I am a complete beginner with very little knowledge. I am trying to do a switch in Arduino UNO using a guide I found on the internet but it won't compile. The servo motor should function if it is ...
0
votes
1answer
1k views

ESP8266 compilation error: “previous declaration of 'HTTPMethod HTTP_HEAD'”

I have an ESP8266 program that used to work but is now failing to compile with this error: C:\...\Arduino\libraries\WiFiManager/WiFiManager.h:25:24: note: in expansion of macro 'PROGMEM' const ...
0
votes
1answer
34 views

Arduino Uno First Program [duplicate]

Please help with this error. Arduino: 1.8.10 (Windows 10), Board: "Arduino Uno" Sketch uses 882 bytes (2%) of program storage space. Maximum is 32256 bytes. Global variables use 9 bytes (0%) of ...
0
votes
1answer
316 views

Can't use uint16_t in library

I wonder why the following minimal example sketch doesn't compile (unknown type name 'uint16_t'): sketch_does_not_compile.ino: #include "myheader.h" void setup() { char a[]="hello world"; ...
0
votes
2answers
47 views

Unable to declare variable in a library that doesn't have a class: multiple definition of the variable

I have created a library Lib that doesn't have a class. I want this library to have a variable that can be accessed from outside. The way I would go about this is to just declare them in the header ...
0
votes
1answer
1k views

Error: function was not declared in this scope when using a library without classes

I have created a library of functions that doesn't have and mustn't have a class. In order to have functions inside the library that can only be called from the library itself, you just write them ...
0
votes
1answer
141 views

Compilation Error - Yellow LED blinking as I have installed & connected Arduino UNO board to Windows XP PC

This is the first time when I have installed Arduino IDE (arduino-1.8.10-windows.exe) in my Win. XP SP-3 OS and it seems that the Arduino IDE software installation is successful without any hitch. ...
-1
votes
2answers
484 views

Compile code error: 'Serial' does not name a type

int LDR_deger = 0; int Ledpin1 = 12; int Ledpin2 = 11; int Ledpin3 = 10; int Ledpin4 = 9; int Ledpin5 = 8; int LDR_pin = 0; void setup() { Serial.begin(9600); pinMode(Ledpin1, OUTPUT); ...
0
votes
2answers
42 views

I don't know why this type of come in my program expected initializer before 'if' [closed]

#include <iostream> #include <stdlib.h> using namespace std; void menu(){ cout<<"1 : First Grade"<<endl; cout<<"2 : Second Grade"<<endl; cout<<"...
0
votes
1answer
46 views

Creating an array with the length coming from a library

When creating an array like in the sketch #include <Lib.h> int myArray[Lib::len]; void setup() {} void loop() {} the variable len must be an integer constant that is known at compile time. ...
0
votes
1answer
4k views

Error: invalid application of 'sizeof' to incomplete type 'int []' when trying to compute the size of an array in a library

I have created a library that contains an array. This is the .h file: class Lib { public: static int arr[]; }; And this is the .cpp file: #include "Lib.h" int Lib::arr[] = {0, 1, 2, 3}; ...
0
votes
1answer
82 views

Using a class inside of another class [closed]

I have a seemingly simple problem that seems to be popular, but after searching several forums I still have not found the answer: How do you use a class inside of another class? I have simplified my ...
1
vote
1answer
1k views

Library compilation error

Need help for this Tutorial. I tried to compile the code, but I'm getting compiling error. I tried to ask on that forum too but got no answer, the error is: In file included from C:\Program Files (...
1
vote
0answers
912 views

FatalError('Invalid head of packet (0x%s)' % hexify(b)) while uploading on ESP8266

I have this error while uploading my code to ESP8266 despite the fact that the code runs without errors. I have the git version of installation for the board. ERROR: File"C:/../../AppData/Local/...
0
votes
1answer
2k views

Error: “'lcd' does not name a type” using LiquidCrystal library

I'm following an online Arduino tutorial/course and trying to make a simple moving character on an LCD screen, but for some reason I get the following error: "error: 'lcd' does not name a type". I'm ...
2
votes
1answer
48 views

Remove Function at Preprocessor Time

I have a single function for debugging messages, used through all the project. When KEYDEBUG is defined as 1 or 0, the function is enabled or disabled as required. #define KEYDEBUG 0 void debugging(...
2
votes
0answers
646 views

error compiling for board node MCU 1.0

Arduino: 1.8.9 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Serial, 115200, 4M (3M SPIFFS)" In file included from C:\Users\Priyaranjan Tiwari\Documents\Arduino\007mcu_php\007mcu_php....
0
votes
2answers
108 views

Compile error in Ubuntu 18.04

I'm trying to compile a code to arudino pro micro, I have the right option for compiling like the port and the type of the board,but I get an error,I can't copy
1
vote
1answer
2k views

Error “avr-g++: error: CreateProcess: No such file or directory” When Compiling Script

Whenever I try to compile a script, the Arduino IDE throws the error avr-g++: error: CreateProcess: No such file or directory. I've already tried reinstalling the IDE, changing the board version in ...
1
vote
1answer
560 views

Using SoftwareSerial.h in .cpp file

I am trying to modularize the different components in my arduino build by using objects, but am having trouble with the one controlling a wireless transceiver, which uses SoftwareSerial.h I believe I ...