0

I'm in the process of trying to take this demo sketch and extract the necessary bits into a modular library that can be included in other sketches.

Here's where I'm at so far.

Here's the test sketch that I'm including it in.

However, when I try to compile it right now, I'm getting...

libraries/Adafruit_CC3000_Dynamodb/sha256.cpp.o: In function `Sha256Class::init()':
/home/me/sketchbook/libraries/Adafruit_CC3000_Dynamodb/sha256.cpp:33: multiple definition of `Sha256Class::init()'
sketch/sha256.cpp.o:sketch/sha256.cpp:33: first defined here

I've been programming for years in other languages, but I'm not all that experienced in C. I'm sure I'm doing something completely stupid, but I can't figure out what it is.

I'm also aware that this code still needs a lot of cleanup work in general. Right now I'm just trying to work toward a basic MVP that works so that I start gradually cleaning things up and making it more OOP one step at a time.

9
  • It looks to me like you have a copy of the sha256.cpp file in your sketch which is causing the problem. Commented Jan 9, 2016 at 21:25
  • @Majenko , nope, but seeing the sketch would probably be useful... I'll get that into a repo and update the Q. Commented Jan 9, 2016 at 21:27
  • The error message tells me you have. "sketch/sha256.cpp.o:sketch/sha256.cpp:33: first defined here" Commented Jan 9, 2016 at 21:28
  • But I'm not sure how to interpret that. I only have one each of sha256.cpp and sha256.h, and I'm only including sha256.h from one place. I added a link to the sketch I'm using to test above. Commented Jan 9, 2016 at 21:34
  • 1
    Which of the myriad of DHT libraries are you using? Commented Jan 9, 2016 at 21:39

1 Answer 1

2

You have an old copy of the sha256 files lingering in the build folder. These will have been output at some point in the past and never been cleaned up since they have been deleted from the IDE.

It is probably a bug in the IDE that doesn't remove the old files.

Restarting the IDE will cure the problem and allow you to compile.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.