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.
134 questions
14
votes
1
answer
2k
views
Why can't my IF statement see a global?
I'm rather new to Arduino programming. I have a problem compiling the following bit of code:
const int relay1 = 10; //Power Relay 1
const int relay2 = 11; //Power Relay 2
const int relay3 = 12; //...
5
votes
2
answers
88k
views
"stray '/302' in program error" when compiling
For some weird reason, the following code doesn't compile. I get a "stray '\302' in program" error around volatile unsigned int encoderPos = 0;, and I have no idea what the issue is. I've been trying ...
5
votes
1
answer
1k
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 ...
4
votes
1
answer
309
views
Ethernet library compilation error
I'm trying to connect my Arduino to the internet, but my Ethernet connection config code fails when I try to verify it, and I'm not sure why.
I'm using an Ethernet shield and have installed the ...
3
votes
1
answer
2k
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 ...
3
votes
1
answer
4k
views
Selected board depends on 'arduino' core (not installed)
When I load the Arduino IDE with Board: Pololu A-Star 32U4 selected, I see:
The current selected board needs the core 'arduino:arduino' that is not installed.
I installed the board manually via these ...
3
votes
1
answer
378
views
Arduino library not working, can't find header
I have fair experience with C/C++ so I decided to have a go at writing my first simple Arduino library. I wrote the code which seems to be fine to me except that it keeps complaining about the header ...
2
votes
5
answers
399
views
Break a big file into smaller files
I had a really big .ino file and I decided to break it down into sub-files.
So I had the .ino file, the globals.h file and the functions.h file.
I moved all the global vars and functions to their ...
2
votes
2
answers
2k
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 ...
2
votes
1
answer
1k
views
Ubuntu class string has no member remove
I am running some code that works fine on my windows system using the .remove method. On Ubuntu 16.04 I get the following errror:
error: ‘class String’ has no member named ‘remove’
To see if it was ...
2
votes
1
answer
6k
views
Compilation Error in nodeMCU along with oneWire temperature sensor ds18b20, and 2x16 LCD display (not I2C)
I am using nodeMCU along with oneWire temperature sensor ds18b20, and 2x16 LCD display (not I2C). I am using Arduino IDE to program nodeMCU. I am getting a compilation error:
C:\Program Files (x86)\...
2
votes
1
answer
297
views
Two libraries collide. Ambiguous functions/variables?
I get several errors once I try to include these two libraries:
error: expected unqualified-id before '{' token
#define DEBUG_PRINTLN(...) {}
#include <DHT.h>
#include <DGS.h>
void ...
2
votes
1
answer
1k
views
i586-poky-linux-g++: no such file or directory Error compiling for board Intel® Edison
I'm facing this compilation issue.
Arduino: 1.8.4 (Linux), Board: "Intel® Edison"
fork/exec /home/jimish/.arduino15/packages/Intel/tools/core2-32-poky-linux/1.6.2+1.0/i686/sysroots/pokysdk/usr/bin/...
2
votes
1
answer
468
views
Problem compiling sketches for the arduino wavgat uno R33
I am configuring the arduino IDE to be able to compile and upload sketches for the arduino wavgat uno R3. I have installed the Arduino IDE, as well as the required drivers for the board. I also have ...
2
votes
1
answer
302
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 ...
2
votes
1
answer
258
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
1
answer
4k
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 ...
2
votes
1
answer
174
views
Arduino IDE compiles, UECIDE not
I'm rewriting a personal project and it doesn't compile under UECIDE 0.9.1, but it does with Arduino IDE 1.8.5.
Target is NodeMCU 0.9 with default options.
Arduino IDE 1.8.5
Archiving built core (...
2
votes
2
answers
6k
views
Compilation Error: "cannot declare 'client' to be of abstract type 'Client'"
I know, it isn't my original code, but I'm using this for a larger project that I am currently working on. I keep getting this error message: "cannot declare 'client' to be of abstract type 'Client'".
...
2
votes
1
answer
128
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 ...
2
votes
2
answers
490
views
Purposely create compile error to fail the upload [closed]
I would like to create a compile error so sketch does not upload in certain cases.
I have written a library with a function that adds pins being used to an array. If the same pin is used twice I ...
2
votes
0
answers
420
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 ...
2
votes
0
answers
754
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....
1
vote
3
answers
7k
views
error: expected primary-expression before '(' token
I have a decent level of programming skill, or at least I thought so. I've been getting an error when compiling this Ardulno sketch. I don't really know what this error means or how to fix it. What's ...
1
vote
2
answers
763
views
Suddenly I can't compile any sketch. Not even a blink sketch that I compiled earlier
I use visual Micro for Visual Studio. Out of nowhere, I can't compile for any board. I tried a blink sketch for the nano, and I get intelisense red underlines for simple things like pinMode, ...
1
vote
1
answer
951
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:
...
1
vote
1
answer
228
views
How to deal with this array correctly?
I am using a led strip WS2812b, an ESP8266 (NodeMCU 1.0) and a gesture sensor APDS9960.
I want that when I move my hand from left to right and from right to left I change the colors of the strip of ...
1
vote
1
answer
36k
views
Cannot convert 'String' to 'uint8_t {aka unsigned char}' in initialization
Hey all I am trying to convert a string into a uint8_t with the following code:
String data = "#255101987";
String tmp1 = data.substring(1, 3);
uint8_t first = (String)tmp1;
I am getting the error ...
1
vote
1
answer
7k
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
2k
views
Multiple definition error when linking firmware.elf
I just can't wrap my head around on how to properly work with multiple files. My code has been getting quite big so I decided to split all the classes into one file each. So I'm left with 6 files:
...
1
vote
2
answers
633
views
Include in different file make different compiling error
I'm have problem compiling a code.
ardutest.ino:
#include "mylib.h"
#include <SD.h>
void setup() {
}
void loop() {
fn();
}
mylib.h:
#ifndef mylib_h
#define mylib_h
#include "Arduino.h"
...
1
vote
1
answer
2k
views
When using LiquidCrystal_I2C.h library, why am I getting "invalid header file" in TinkerCad?
This is a link to the guy that made the project work, it seems that I'm unable to make it work by myself: the project.
What am I doing wrong?
/* DICTIONARY - CC = ConClusion ; */
/* LEGEND - ...
1
vote
1
answer
919
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 ...
1
vote
1
answer
72
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 ...
1
vote
1
answer
140
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
1
answer
2k
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 ...
1
vote
1
answer
3k
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 ...
1
vote
1
answer
276
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
# ...
1
vote
1
answer
634
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 ...
1
vote
1
answer
17k
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};
When ...
1
vote
1
answer
2k
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
1
answer
947
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 ...
1
vote
1
answer
1k
views
Error: "undefined reference to ..." when calling non-void class' functions from within class
I haven't used an Arduino for anything as complicated as this project before (single sketch projects so far), and am struggling getting my code to compile now that I'm creating my own libraries for ...
1
vote
1
answer
225
views
Problem with simple coding for PLDuino: trying to turn relay on and off
I am writing the following, simple code to try to turn a relay in the PLDuino on and off, and it is giving me warnings and not compiling/uploading. Any help would be greatly appreciated. Here is my ...
1
vote
2
answers
12k
views
SIM900A A6 module Arduino +CME error 58
I've recently bought a SIM900A A6 GSM module. Whenever I send a command it gives an error: +CME error 58.
Does anybody know what this means and how to solve it?
1
vote
1
answer
2k
views
'AttachPinChangeInterrupt' was not declared in this scope
I am a beginner trying to upload the SimpleExample328.ino sketch on my Arduino Uno. When I verify my sketch however, I run into the error:
'AttachPinChangeInterrupt' was not declared in this scope.
...
1
vote
0
answers
47
views
"'StructName' does not name a type" when returning struct, but trailing return type works [duplicate]
Note: Please, do actually read the question before voting to close. This only happens in arduino IDE, this is not about a generic "Does not name a type" error. The code is perfectly valid as ...
1
vote
0
answers
125
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 ...
1
vote
0
answers
896
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
272
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 ...