Questions tagged [compiler]
A compiler converts source code (C++, Java, etc) to machine code which is what the CPU runs.
38 questions
7
votes
3
answers
14k
views
Is there a constant for the Maximum Unsigned Long value in an Arduino compiler?
I am writing a timer function that uses the micros() function which generates a unsigned long value. To compensate for a roll over condition, I would like to use the maximum value for that variable ...
6
votes
3
answers
3k
views
Using Arduino as a standalone compiler
I mostly program in C/C++ so I conviniently have a GCC compiler for all my compilations. I was wondering if there is a special compiler for Arduino that can be used just like the GCC Compiler? Because ...
5
votes
1
answer
21k
views
Multiple definition of "..." Compiler Error
I am creating a simple library to test how multiple files in an Arduino program works. I have three files. MotorController.ino:
#include <motor.h>
void setup() {
motorInitialize();
}
void ...
4
votes
1
answer
621
views
Does the compiled binary of a sketch include uncalled functions from a library?
I am writing a GUI using a TFT display and the Adafruit GFX library and its default font on Arduino Nano.
I want to be memory efficient and I assumed that the 'optimise for size' default setting of ...
3
votes
3
answers
5k
views
Arduino IDE c++ 11 raw string literal have issues with // in http://, complier thinks // is comment
char webpage[] PROGMEM = R"=====(
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/svg.js/2.6.6/svg.min.js"></script>
</head>
<body>
&...
3
votes
1
answer
2k
views
Compiling error:passing as 'this' argument
I am trying to make a small keyboard class to handle two buttons(in the future >2) that are connected to my arduino UNO. The buttons being pressed are detected using interrupts. Here is the code:
...
2
votes
2
answers
2k
views
What is the Arduino compiler's version of `__unused` for function parameters?
When I first started with the Arduino environment I noticed that it had File | Preferences | Compiler Warnings set to None, so I set it to All - and there were many, many warnings in the supplied ...
2
votes
1
answer
3k
views
ld.exe:linker_script.ld:138 cannot move location counter backwards | ArduinoFFT Error
Board: Arduino Nano 33 BLE Sense
I'm pulling PCM data from an onboard microphone and running it through the arduinoFFT library (version 1.5.6) to obtain a spectrogram. Since the arduinoFFT library ...
2
votes
1
answer
259
views
How to make the compiler ensure that local variables memory allocation won't cause any RAM overflow during execution?
Upon compiling a sketch using the Arduino IDE, a message like the following gets displayed in the console:
Global variables use 1540 bytes (75%) of dynamic memory, leaving 508 bytes for local ...
2
votes
1
answer
1k
views
Arduino IDE - scope of the pre-processor "#define"
I'm creating an Arduino library and have 3 files - a "test.ino" program, and two library/class files: "testLibrary.h" and a "testLibrary.cpp".
The library makes use of ...
2
votes
0
answers
38
views
Unnecessary recompille after connection error
I sometimes multitask during a large compile (wifi, etc libraries) and don't get back in time to press the ESP32 upload button. If the connection times out, the IDE recompiles all the source again. ...
1
vote
3
answers
1k
views
Arduino constant vs Microchip PIC constant
2.2 THE BASICS OF C PROGRAMMING LANGUAGE book is has like this,
CONSTANTS
A constant is a number or a character having fixed value that cannot be changed during program execution. Unlike variables, ...
1
vote
2
answers
296
views
Why are some letters reserved?
I wrote a function that takes characters and noticed that the Arduino Compiler treated some characters like system-reserved, and other like functions, and a few just like characters. Lowercase doesn't ...
1
vote
1
answer
1k
views
Force compiler to execute instructions sequentially?
Is there a way to force the Arduino compiler to compile individual commands sequentially? Looking at the disassembly, lines of the assembly code for different C/Arduino commands are mixed. I was ...
1
vote
1
answer
1k
views
Compiler error: final link failed: bad value collect2.exe
I work With VS Code v:1.59.1.
With extension vscode-arduino v:0.4.4
befor update of vscode. in version 1.58. all was ok. I can build and upload code for all mucrocontrollers.
but after the update, I ...