Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [compile]

To compile is to convert the code for a sketch into machine readable files that are uploaded to the Arduino. This tag is mostly used for the space and footprint of the files uploaded to the Arduino.

1
vote
0answers
52 views

Why does the program size increase so drastically with these switch-cases?

EDIT: The problem is my op-code catch is op >= 0x20 || op <= 0x2F rather than op >= 0x20 && op <= 0x2F and so most of the switch-case was being optimised away! This is a really ...
5
votes
1answer
929 views

How can I have code in a project that won't compile for Arduino?

I want to test the algorithms in my code without needing to send it to an actual Arduino board. I figured I could lay out my project like: project/ core.cpp # core algorithms core.h ...
0
votes
1answer
169 views

'dynamic_cast' not permitted with -fno-rtti

class A { virtual ~A(); } class B : public A { public: int foo; } void bar(A *foo_){ B* b = dynamic_cast<B*>(foo_); if(b != nullptr){ cout << (*foo_)->...
0
votes
1answer
70 views

How do I make Arduino IDE use a specific version of GCC in Debian?

Using Raspbian Stretch. I installed gcc-4.9 with specified version. Then I installed arduino (2.1.0.5) which in turn pulled gcc 4.6. When I try to compile Marlin in it, it says Marlin requires C++...
0
votes
0answers
19 views

TM1637 is showing error [duplicate]

When I try to use the 4-digit display TM1637 with the relevant library on an arduino UNO board this error message keeps popping up.Please help me trouble shoot what is wrong with this device ? the ...
1
vote
0answers
117 views

Prevent Arduino IDE from rebuilding the core library after every restart

I have an Arduino IDE 1.8.5 setup (installed from the ZIP file) which I use to work exclusively with a single board. Every time the IDE is restarted, the first compilation takes much longer than ...
0
votes
1answer
62 views

Headers linking - PlatformIO

For those who use the IDE Platform IO, I have an issue for you. I use to program a home application of sensor reading and use the library "JC_Button.h" to manage buttons. There are other third-party ...
1
vote
1answer
41 views

Changing type of one variable dramatically changes compile size

I have a sketch containing the following method: // Writes zeros to the complete screen clearing it: void clearScreen(uint8_t val) { setDrawArea(0x00, 0x7f, 0x00, 0x07); // complete screen ...
0
votes
0answers
29 views

Cannot load anything from library

So I installed libraries through the Arduino interface (Sketh->Include Library->Manage Library). Then I check: C:\Users\username\OneDrive\Documents\Arduino\Libraries, and I confirm the new libraries ...
1
vote
0answers
369 views

ESP8266 can't read parasitic DS18B20 temperature (reset during conversion, 85°C)

tl;dr at the end I was running two DS18B20+PAR temperature sensors without any problems for the last two years on an ESP-01 module running on 3.3V on GPIO 2 using a 4.7K pullup resistor. Now, ...
0
votes
1answer
85 views

Compiling with -flto and -nostartfiles results in no program at all

Towards developing my own bootloader I've stumbled over an issue with avr-gcc. I am trying to compile my code with the compiler flags -flto #to enable link time optimization -nostartfiles #...
2
votes
2answers
109 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 ...
1
vote
1answer
591 views

Segmentation fault at Serial.begin()

I try to communicate with my Arduino clone (Elegoo Uno R3) from Arduino IDE (v1.8.4 installed by dnf from repos) at Fedora 27. Compiling and upload of normal example code works well. However, as I try ...
1
vote
2answers
2k views

multiple definition of local variable in linking

I am trying to make my own library and it uses some local variables with the same name as some variables in ino. Compiler complains about it. I stripped it to (nonsence but simple) example mylib.h: #...
1
vote
1answer
2k views

Warning when verifying sketch with VS code

I use Visual Studio Code to develop for arduino which uses Arduino Studio installed files and needs the installation to work. This works very well. Annoying is that when verifying a sketch it takes ...
0
votes
0answers
291 views

compiling error with (VirtualWire) function vw_get_message (uint8_t *buf, uint8_t *len)

I'm trying to connect 2 Arduinos with a RF 315 MHz transmitter-receiver module, but when I tried to run the receiver example i got this error: /tmp/ccrWAAlS.ltrans0.ltrans.o: In function `main': ...
0
votes
2answers
82 views

Efficiency of a cast vs a shift

I'm using a supplied library which uses a number of (non-sequential) outputs to latch a multiplexer. The code looks (in part) like this: digitalWrite(_S0, (chan & 1)); digitalWrite(_S1, (...
3
votes
1answer
177 views

Why don't these sketches produce a similar output?

I compiled the following two sketches with the compiler used by the Arduino IDE and ran them on an Arduino UNO (smd edition). I'm using: Arduino IDE v. 1.8.0 Arduino AVR Boards v. 1.6.20 1. void ...
0
votes
2answers
39 views

Preprocessing problem

I've a little problem, I'm trying to create a library with processor variables for tune it. So in .ino I declared my preprocessor var, but preprocessor variables appear not defined in my library. (...
0
votes
0answers
54 views

Get arduino pre-processed code

i'm running Arduino 1.8.3_1 and avr-gcc 6.3.0_1. Unfortunately, there is a bug that do not allow me to compile any program containing any Serial library function. I had reported arduino bug and gcc ...
1
vote
0answers
120 views

How to cross compile Arduino code?

How do you cross compile Arduino code using Arduino-Makefile? I have an Arduino attached to a Raspberry Pi. Compiling the Arduino C code on an x86 machine in about 2 seconds, but doing the same ...
2
votes
3answers
693 views

If statement comparing array to value list throws error

In my program I have the following lines of code: if (invest == {0, 1, 0, 0}) { //code } However, upon attempting to compile the code, I receive the following error: exit status 1 ...
0
votes
0answers
672 views

Uploading error on ESP8266 (an error occurred while uploading sketch)

Arduino: 1.8.3 (Linux), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, Serial, 115200, 4M (3M SPIFFS)" Archiving built core (caching) in: /tmp/arduino_cache_562346/core/...
1
vote
1answer
354 views

I need to restart Arduino IDE after each compilations

I'm using the Arduino Due and testing an I2C Scanner, the I2C Scanner works correctly but each time I want to upload a newer version of the code I get this error message : No device found on COM11 ...
0
votes
1answer
4k views

fatal error: avr/io.h: No such file or directory

I'm compiling a project on Due that was working correclty using UNO. I get this error : 'avr/io.h: No such file or directory'. Searching across the web, it seams I'm not the only one to get that error ...
0
votes
0answers
237 views

Arduino IDE 1.8.2 and libraries for Tian

I installed the 1.8.2 IDE but I cannot upload anything for the Tian board. I get the following error: Board tian (platform samd, package arduino) is unknown Error compiling for board Arduino Tian. ...
0
votes
2answers
225 views

Error trying to compile an example from newly added Arduino menu library

I added the ArduinoMenu library https://github.com/neu-rah/ArduinoMenu and when I try to compile one of the examples, I get following error. Using library LiquidCrystal at version 1.0.5 in folder: ...
1
vote
2answers
574 views

How get assembler/preprocessed code for library

I am using https://github.com/sudar/Arduino-Makefile project with https://github.com/ladislas/Bare-Arduino-Project to compile my Arduino projects from Linux command line. I put as much as possible ...
2
votes
2answers
551 views

Compiling code via terminal

How can I compile my code via terminal? I am working on a Chrome app that allows you to write, compile, and upload code to an Arduino, and I need to know this so I can use the command line compiler on ...
0
votes
1answer
3k views

My Digispark board won't show up in Ports tab in Arduino IDE (OSX)

I bought a Digistump/Digispark board online and when i received it, I plugged it into my iMac to see if it works. I went to the apple in the top left corner and clicked "About this Mac". Then I ...
1
vote
1answer
120 views

How to program an Arduino Uno Pro with a makefile?

I'm using Arduino Makefile to compile sketches for Uno and Mega boards. I'm now trying to compile a sketch for an Arduino Uno Pro, which is an Uno with a replaced chip to give it features more like a ...
1
vote
1answer
565 views

How to programmatically upload an Arduino sketch generated by node.js (electron) or from browser?

We are trying to make an app that generates an Arduino sketch (.ino) using Google's Blockly and node.js, and uploads it to Arduino. Even after searching a lot, I am unable to find how to build and ...
0
votes
1answer
2k views

Win10 64bit, IDE 1.8.0 back to IDE 1.6.13 won't compile anything including Blink. 1.6.12 does compile

Arduino: 1.8.0 (Windows 10), Board: "Arduino/Genuino Uno" c:\program files (x86)\arduino\hardware\tools\avr\bin../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe: unable to rename 'core\core.a'; reason: ...
0
votes
2answers
154 views

What do I do about a compiler error “ variable 'font' must be const”

I am trying to run the test program from Adafruit, with their libraries, for an Arduino controlling a Nokia5110 display and get this error message: Arduino: 1.5.8 (Linux), Board: "Arduino Pro or Pro ...
0
votes
1answer
148 views

How do I see the command line equivalent of clicking Verify?

I am using the ESP8266 board manager. I want to see how Arduino IDE compiles my code once I click Verify. Why do I want to do this? I am trying to integrate a C library for which there is now ...
0
votes
2answers
283 views

Why can't my .cpp file have a class of the same name?

I made a new Arduino IDE project ABC, and am given ABC.ino. Then I create a XYZ.h and XYZ.cpp. ABC.ino: #include "XYZ.h" void setup() {} void loop() {} XYZ.h: #ifndef XYZ #define XYZ #include "...
1
vote
2answers
350 views

Compiling sketch vi command line

Since I don't like the text editor of the Arduino IDE, I decided to write a python script that I can invoke from my text editor to compile and upload my source. I program the popular esp8266 chip. So ...
0
votes
1answer
74 views

avr-gcc -D is ignored

Im trying to use XCode to compile avr program with arduino libs but seems like something wrong with my Makefile because it throws me warnings like # warning "F_CPU not defined for <util/delay.h&...
3
votes
1answer
109 views

Referencing local libraries from higher dir levels

How can I include libraries not contained in any direct subdirectories of a sketch, using the Arduino IDE? I want my project structure to look like this: Project └> MCUa └> MCUa.ino └> ...
1
vote
2answers
777 views

How to properly understand verbose compiler error text? For beginner level

I'm an Arduino newbie, no background in C/C++, needing help to understand Arduino IDE verbose output about compiler errors. My searching failed to find suitable info - have I missed a relevant guide? ...
1
vote
1answer
116 views

I swear this worked yesterday!! - mysterious compiler error

I thought I finally had this working yesterday, the code compiled, and executed on the arduino, there were however some small quirks but today I went to fix a small timing issue, but got the following ...
-1
votes
1answer
94 views

where to get Arduino WIFO101 library that supports WiFi.beginAP() on board MKR1000

The sketch example from page "Wifi.beginAP()" causes compiler error because the return values are not defined for -WL_AP_LISTENING or -WL_CONNECT_FAILED. Board: Arduino MKR1000 WiFi Compiler: ...
1
vote
1answer
156 views

How to change Arduino Nano MODEL_ID

I'm working on a project using a set of different Arduino Nano connected to a Raspberry Pi through USB. Now my question is: "how can I, from the Pi's point of view, differentiate all of those Arduino ...
-3
votes
1answer
112 views

arduino uno board [closed]

again we have an error while compiling the program in arduino uno. The error is exit status 1 'WDTCR' was not declared in this scope. how to rectify the error .please reply as soon as possible
-2
votes
1answer
46 views

No power_usi_disable() on Arduino Uno

we have an error after compiling the code in arduinouno that is displayed as error: 'power_usi_disable' was not declared in this scope in Board: "Arduino/Genuino Uno".how to rectify this error. ...
0
votes
1answer
6k views

Compilation Error

Hi everyone I seem to have run into a problem while uploading a library to the board. I managed to import the library to Arduino Uno, however, i could not upload it Please Help :) Thanks in Advance ...
1
vote
1answer
362 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
1answer
151 views

How to use same sketch on two different computers in two different directories

I have the same sketch one that I use at my desk and in the lab, but they are in different directories on the different computers. This means that I have to change the paths to the includes which I ...
1
vote
3answers
2k views

How to include <SPI.h> outside the .ino file

As I understand, Arduino IDE considers two paths for the libraries: first, "C:\Program Files\Arduino\libraries" and second, the "libraries" folder next to the schetchbook. I have a ...
1
vote
3answers
374 views

Compile Error for Arduino Mega

I am using the Arduino IDE 1.6.0, There is a project that has compiled both for Due and Mega on another computer. But on my machine, it only compiles for Due. When compiling for "Mega or Mega 2560", ...