-
Notifications
You must be signed in to change notification settings - Fork 447
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Makefile miscompiles IRremote #376
Comments
i suspect this is related to #93 where libraries that include other libraries aren't detected. you probably need to look for all the #include lines and add them to your main sketch, for example IRremote.h calls that said, i changed the first line of your sketch to
|
The compilation is not the problem. IRremoteInt.h is not an other library, is just an other header file in the same library. The problem can only be detected at run time when the sketch fails to run properly. irrecv.enableIRIn(); and never gets to the end of setup(). The issue #93 seems to be with compilation issues. |
the two build outputs don't seem to be for the same sketch - they have different names and are considerably different in size. not sure what we can do if it builds/links/uploads ok. it may be worth while asking the library authors what they think it may be....? |
The sketch was the same, I put it in 2 separate folders just to void interference. Till the last rev working the sizes of arduino vs makefile are very similar with master on the other hand something is different. /~https://github.com/z3t0/Arduino-IRremote/issues/214 This is the output from the file in the same location |
Found it. The IDE and the Makefile link the sketch in 2 different ways
The difference is where the code for the libraries goes:
Apparently the linker will include all objects explicitly mentioned and pick from the static lib only objects really needed. In IRremote there is a file irISR.cpp which exports no symbols, but defines the timer/interrupt, so if the linker is not forced it will NOT link it. Probably this is a weak feature of the linker to rely on, but at the same time the IDE is "the" reference. I will propose to IRremote a change to fix this. |
ah well done! i suspect this is a side effect of the preprocessing that the ide does - basically concatenates all of the libraries and the sketch into one giant c++ file. see /~https://github.com/arduino/Arduino/wiki/Build-Process and #59, i don't think its something we can simulate with the makefile. i guess it guarantees that everything will get linked and users don't have to declare their methods before calling them etc. as you do with "proper" c++; the side effect is that all libraries get compiled (#29) thanks for raising it with the IRremote guys, they seem pretty receptive. funnily enough i tried this library a few weeks back and it didn't work for me - i think it sent something as my camera picked up the led flashes, but my tv did nothing, and i certainly didn't receive anything back from my remote control, this perhaps explains why! |
The fix has been applied to IRremote. Works well now. |
…bsence of exported symbols from irISR.cpp see /~https://github.com/z3t0/Arduino-IRremote/issues/214 sudar/Arduino-Makefile#376 In some circumstances the linker skips irISR.cpp irRemote.cpp is always included (by the linker). Andrea
Hi,
I am trying to compile IRremote from
/~https://github.com/z3t0/Arduino-IRremote
with the Makefile
the Makefile I use is
and the library IRremote is in /home/andrea/Arduino
the sketch is
which is based on one of the examples of the library.
But if I compile with the Makefile nothing works, with arduino 1.6.5 it is good.
With the Makefile it compiles, links, uploads, but it is like some parts of the code are not there.
This started happening at this revision
Arduino-IRremote/Arduino-IRremote@88e243f
which seems to have split the library in many pieces.
Compilation log with Arduino 1.6.5
http://pastebin.com/ZZYU2dtC
with this Makefile
http://pastebin.com/3kv4HznZ
The text was updated successfully, but these errors were encountered: