Using different library version

I have a library in Arduino/libraries/ called GSMSHIELD. Ive used it before and it works fine. But I want to make some changes to the library, enough changes that merit a new library. So I created a folder called Arduino/libraries/mygsm apart from the existing Arduino/libraries/GSMSHIELD.

But includes are usually defined as simply #include <somefileinsidethefolder.h>

How do I make sure Im using the mygsm/somefileinsidethefolder.h instead of GSMSHIELD/somefileinsidethefolder.h?

You have to rename the .h and .cpp files in that folder to match the name you gave the folder or they're not going to be seen. Then you know which version you are using because they have a different name.

As an added bonus, when you do that, and then put your code on github, it will be obviously not the same as the old one, so people won't get confused about which version of the library it is.

Ok I made the mods to the files, I added a z to each one. Now I only get 2 errors:

In file included from /Users/quique123/Documents/Arduino/TempMonitorGPRSw_oLibrary/TempMonitorGPRSw_oLibrary.ino:6:0:
/Users/quique123/Documents/Arduino/libraries/mygsm/SIM900z.h:4:10: error: #include expects "FILENAME" or <FILENAME>
 #include “HWSerialz.h”

          ^
/Users/quique123/Documents/Arduino/libraries/mygsm/SIM900z.h:5:10: error: #include expects "FILENAME" or <FILENAME>
 #include “GSMz.h”

Im not sure why its complaining. The SIM900z.h file has the following imports:

#ifndef SIMCOM900_H
#define SIMCOM900_H
#include <SoftwareSerial.h>
#include “HWSerialz.h”
#include “GSMz.h”

The only thing I can think of is you have some hidden characters in there messing it up. I've see that before where, as in this case, I can copy the code they pasted to the forum but their original code doesn't work. This is because the forum will strip those hidden characters. If you attach a copy of SIM900z.h and I'll take a look.

Yeah I think it was those pesky " ". So I changed them all to <>. Now all those are gone but I get this:

ailed MSpanList_Insert 0x2ff810 0x56b087c426e 0x0
fatal error: MSpanList_Insert

runtime stack:
runtime.MSpanList_Insert(0x2bacf0, 0x2ff810)
/usr/local/go/src/runtime/mheap.c:692 +0x8f
runtime.MHeap_Alloc(0x2b8c00, 0x1, 0x10000000020, 0x103a9)
/usr/local/go/src/runtime/mheap.c:240 +0x66
runtime.MCentral_CacheSpan(0x2c1938, 0x2c4198)
/usr/local/go/src/runtime/mcentral.c:85 +0x167
runtime.MCache_Refill(0x2f8000, 0xc200000020, 0xc208012000)
/usr/local/go/src/runtime/mcache.c:90 +0xa0

goroutine 1 [running]:
runtime.switchtoM()
/usr/local/go/src/runtime/asm_amd64.s:198 fp=0xc20834f588 sp=0xc20834f580
runtime.mallocgc(0x480, 0x198b20, 0x0, 0xc20806a240)
/usr/local/go/src/runtime/malloc.go:178 +0x849 fp=0xc20834f638 sp=0xc20834f588
runtime.newarray(0x198b20, 0x4, 0x151d00)
/usr/local/go/src/runtime/malloc.go:365 +0xc1 fp=0xc20834f670 sp=0xc20834f638
runtime.hashGrow(0x151d00, 0xc20833fa10)
/usr/local/go/src/runtime/hashmap.go:744 +0x86 fp=0xc20834f6a0 sp=0xc20834f670
runtime.mapassign1(0x151d00, 0xc20833fa10, 0xc20834f7b8, 0xc20834f7a8)
/usr/local/go/src/runtime/hashmap.go:456 +0x568 fp=0xc20834f740 sp=0xc20834f6a0
arduino.cc/builder/utils.MergeMapsOfStrings(0xc20833fa10, 0xc20834f8c8, 0x1, 0x1, 0x8)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/utils/utils.go:74 +0x153 fp=0xc20834f838 sp=0xc20834f740
arduino.cc/builder.(*RecipeByPrefixSuffixRunner).Run(0xc20801e360, 0xc20803c540, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/recipe_runner.go:58 +0x47b fp=0xc20834f9b0 sp=0xc20834f838
arduino.cc/builder.runCommands(0xc20803c540, 0xc20834fbb8, 0x1b, 0x1b, 0x1, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:155 +0x139 fp=0xc20834fa40 sp=0xc20834f9b0
arduino.cc/builder.(*Builder).Run(0xc20834fd90, 0xc20803c540, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:115 +0xe25 fp=0xc20834fd70 sp=0xc20834fa40
arduino.cc/builder.RunBuilder(0xc20803c540, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:186 +0x49 fp=0xc20834fd98 sp=0xc20834fd70
main.main()
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/main.go:315 +0x1d64 fp=0xc20834ff98 sp=0xc20834fd98
runtime.main()
/usr/local/go/src/runtime/proc.go:63 +0xf3 fp=0xc20834ffe0 sp=0xc20834ff98
runtime.goexit()
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc20834ffe8 sp=0xc20834ffe0
arduino-builder returned 2
Error compiling.

I’ve gotten this in the recent past, as recent as last week. I would just click on the verify button again in Arduino IDE, and it would compile without errors the second time around. But this time Ive clicked the verify button 4 and 5 times and I still get that stuff.

The #include “HWSerialz.h” syntax is actually more correct. For your application either will work but if you try to use the library inside the sketch folder instead of the {sketchbook}/libraries then #include <HWSerialz.h> doesn’t work because it will only look in the include path, which doesn’t contain the library.

Which operating system and which Arduino IDE version are you using? The error looks like Cannot compile larger projects on macOS Sierra GM · Issue #5360 · arduino/Arduino · GitHub to me, which should be fixed by updating to Arduino IDE 1.6.12.

Thanks, I got it. I still get those warnings sometimes but then they go away.

Oh I have 1.6.6. Is there a way to update from the IDE itself, or do I have to download the actual file?