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
-1 votes
0 answers
39 views

How can i solve this error?

*** File preferences.txt not found on Windows *** 'preferences.txt' file missing from well known locations. exit status 1 Error compiling for board NodeMCU 1.0 (ESP-12E Module).
0 votes
0 answers
28 views

Compilation error with MMA8451 accelerometer and attiny85 using ATTinyCore

I am trying to use the Adafruit MMA8451 accelerometer with an attiny85. The Adafruit library uses Wire which doesn't work on the attiny so I used the ATTinyCore board files which have been modified to ...
4 votes
1 answer
268 views

Library not found when using the arduino-cli command (although working with the Arduino IDE)

I have a sketch which I can upload without problem with the Arduino IDE. I installed the arduino-cli Version: 0.28.0 Commit: 06fb1909 Date: 2022-10-18T15:53:04Z. I want to compile and upload a code ...
  • 145
1 vote
0 answers
76 views

Inconsistant compilation error

It is s a bit complicated to ask such question, but what may be the reason that one time compilation passes and other fails without any changes in code? surely debugging this way is very hard (one ...
  • 909
2 votes
1 answer
64 views

error: 'MonoOutput' has not been declared (Mozzi library, Arduino Nano)

I know this error is specific to this particular family of sketches, but please bear with me; when I try to compile this against an Arduino Nano/Uno (with Arduino IDE 1.8.15) the compiler complains ...
-1 votes
1 answer
37 views

Initializing an object as class member resulting in linking error?

I'm a little dumbfounded as to why this isn't working. I keep getting the following linker error: In file included from src\ac.cpp:1:0: src/ac.h:9:21: error: expected identifier before numeric ...
  • 3
0 votes
1 answer
2k views

variable or field declared void Error

For a larger sketch, I have separated a chunk of code in a separate .cpp file #include "msg.h" #include <Arduino.h> #include <HTTPClient.h> #include <ArduinoJson.h> void ...
  • 183
0 votes
1 answer
654 views

Add library to CLion project

I have a new project created with PlatformIO in CLion. I've copied the Servo-1.1.8 library into the include directory. #include <Arduino.h> #include "Servo-1.1.8/src/Servo.h" Servo ...
  • 109
1 vote
0 answers
110 views

avrdude: ser_open(): can't set com-state for "\\.\COM4" [duplicate]

My Arduino code is not getting uploaded. It gives me "avrdude: ser_open(): can't set com-state for "\.\COM4" error. It worked literally 5 mins ago. now it doesn't work. I updated the ...
1 vote
0 answers
124 views

Arduino IDE Java error

I'm running IDE version 1.8.16 under Windows 10. Frequently I get the error message. The situation is solved only when exiting the IDE. Afterwards the compilation may be finished with or without ...
1 vote
1 answer
43 views

Libraries are not linked

I created 4 libraries, each in .h and .cpp files, and tested them individually. I kept the project flexibility by defining 3 flags that allow or disallow the usage of the libraries. When integrating ...
0 votes
1 answer
149 views

Problem in upload bootloader into esp32

I have problem with my esp32 Device and asked one question as you can see below: How to understand the ESP32 is working (Error: Arduino unknown board ...) As it is not fixed, so I am thinking to ...
1 vote
1 answer
540 views

'GIMSK' was not declared in this scope

I'm programming an ATTiny 85 using the Arduino IDE and an Arduino Nano as "Arduino as ISP" to program the ATTiny. I succeeded a week ago and now I want to program a second chip but get the '...
1 vote
3 answers
625 views

What should I do with stackOverflow in compile error?

I don't have port, but when I want to compile my code (even empty files), I encounter this error: Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes. Global variables use 9 ...
  • 11
1 vote
1 answer
4k views

invalid conversion from 'char' to 'const char*' [-fpermissive] on a string

I am compiling some code I didn't write, and it bombs out with the error message invalid conversion from 'char' to 'const char*' [-fpermissive] on the line if (loginPassword == '\0') loginPassword = &...
1 vote
1 answer
372 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: ...
  • 53
1 vote
0 answers
112 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
1 answer
872 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 ...
  • 1,184
0 votes
3 answers
205 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() { ...
  • 119
0 votes
1 answer
566 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
1 answer
40 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
1 answer
448 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
2 answers
1k 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 ...
  • 205
0 votes
0 answers
543 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
1 answer
203 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
1 answer
93 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
1 answer
89 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 ...
  • 11
1 vote
0 answers
112 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 ...
-1 votes
1 answer
238 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
1 answer
460 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 ...
  • 21
1 vote
1 answer
2k 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
1 answer
86 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
1 answer
187 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/...
  • 23
1 vote
1 answer
190 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 # ...
  • 111
0 votes
1 answer
475 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
2 answers
2k 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
1 answer
265 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(...
-1 votes
1 answer
3k 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
1 answer
44 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 ...
2 votes
0 answers
354 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
1 answer
2k 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 ...
  • 149
1 vote
1 answer
53 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
1 answer
2k 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 ...
  • 1,809
0 votes
2 answers
57 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 ...
  • 315
0 votes
1 answer
4k 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 ...
  • 315
1 vote
1 answer
463 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. ...
0 votes
2 answers
2k 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); ...
  • 11
0 votes
1 answer
103 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. ...
  • 315
1 vote
1 answer
11k 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}; ...
  • 315
0 votes
1 answer
213 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 ...
  • 3