Pages: [1]   Go Down
Author Topic: Forcing IDE/AVRDude to re-compile libraries after changes have been made  (Read 329 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I'm trying to make some changes to a library but none of the changes I make have any effect.

I've edited (and deliberately broken a function I use) the file UIPClient.cpp from within the UIPEthernet library (~/Documents/Arduino/libraries/UIPEthernet/UIPClient.cpp) but my sketch still compiles fine.

Before trying this I had made some changes to timeouts, but these had no affect, which was what lead me to trying to see if my changes did anything at all. They appear not to make it into what's sent to the board.

I think it's because the library is already compiled and the IDE is just using the existing cache.

I'm on a Mac by the way, which I'm not as proficient with in terms of the file system (vs Windows), which isn't helping!

Things I've tried...

- Looked for .o files to delete in the library, but can't see any.
- Deleted temp files in /var/folders/67/ which was where AVR Dude said the files were when I enabled verbose logging
- Switching boards between one and another

I'm sure I'm missing something silly, but I'm a bit stuck!

Thanks,
Sam
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also I have since tried...

- Removing the library folder - the sketch then won't compile, so I know I'm at least working in the right folder.

- Renaming the file in question, but the sketch compiles fine.

The sketch includes UIPClient.h, but I'm editing UIPClient.cpp. I assume this is normal, there isn't any functional code in the .h
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you turned verbose mode on? Perhaps a clue will present itself.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, thanks for your reply.

Yes I have and I've deleted the temp files as far as I can tell - it seems they get put here (this is the file name I have edited too):

/var/folders/67/tk_62j613zndcfwxl3t04sb00000gn/T/build455435735465891803.tmp/UIPEthernet/UIPClient.cpp.o

When I next compile, I get the error 'Build folder disappeared or could not be written' (so I'm pretty sure I deleted the right one).

Now if I close the IDE and open it again, then compile it works, but I don't think it should work... I messed with the code. There's no way that should compile.

  unsigned long starttime = millis();
  if (conn)
    { ERRORS ERRORS ERRORS ;{errors}
      while((conn->tcpstateflags & UIP_TS_MASK) != UIP_CLOSED and 1==2)
        {;

It's still using whatever it's got from before  smiley-confuse
Logged

Worst state in America
Offline Offline
God Member
*****
Karma: 32
Posts: 792
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Also I have since tried...

- Removing the library folder - the sketch then won't compile, so I know I'm at least working in the right folder.

- Renaming the file in question, but the sketch compiles fine.

The sketch includes UIPClient.h, but I'm editing UIPClient.cpp. I assume this is normal, there isn't any functional code in the .h

If you are in windows, check the %temp% (yes, that's "percent-temp-percent") directory.

I added a "Clean before compile" option to my IDE just for that purpose. However, I run Linux so I delete the IDE work files in "/tmp".

You don't delete the whole directory... you only delete the *.o and *.d files.
« Last Edit: February 06, 2014, 08:36:34 pm by Krupski » Logged

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think it would probably be easier on Windows, unfortunately I'm working on a Mac for this.

Surely there's something simple I am missing? It can't be this hard, developing a library would be a nightmare otherwise, you'd only get to test it once.
Logged

Worst state in America
Offline Offline
God Member
*****
Karma: 32
Posts: 792
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I think it would probably be easier on Windows, unfortunately I'm working on a Mac for this.

Surely there's something simple I am missing? It can't be this hard, developing a library would be a nightmare otherwise, you'd only get to test it once.

In MacOS, I would think the files are in "/tmp" since MacOS is actually BSD Linux.... (Leopard 10.5 and above)

If you find the files, try this command line in the "build.........." folder of the project you are trying to compile.

WARNING THE FOLLOWING COMMAND DELETES FILES - TEST IT IN A TEMPORARY DIRECTORY FIRST!

find -name '*.[d|o]' -exec rm {} \;

Not sure if the syntax is exactly right for BSD.... but the idea is "find all files ending in .o or .d in this directory and all below and delete them".
Logged

Gentlemen may prefer Blondes, but Real Men prefer Redheads!

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the tip, I'll try this soon, the only thing is I have already deleted all the temp files and it's still using a cached/compiled version of the library without my changes... so not sure this would really help.

Also, again surely I am missing something silly here. There must be a way to just tell the IDE 'recompile everything' or recompile the library I've just edited.
Logged

UK
Offline Offline
Tesla Member
***
Karma: 101
Posts: 6306
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried selecting a different board (say a Mega if you are programming for an Uno) and clicking verify. Don't worry if there are errors. Then change the board back to Uno.

The IDE seems to do a full when the board is changed - maybe it will solve your problem.

...R
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 14
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Works perfectly on Windows, Mac OSX is doing something weird with files... guess Apple knows better than what I tell it to do  smiley-roll
« Last Edit: February 09, 2014, 07:39:46 pm by Sam2D » Logged

Pages: [1]   Go Up
Jump to: