duino-coin icon indicating copy to clipboard operation
duino-coin copied to clipboard

Compiling issue

Open jaybrown47 opened this issue 5 years ago • 12 comments

Trying to load onto an arduino uno. IDE is up to date, most rectent version of Duino-coin but getting following error message.

Arduino: 1.8.15 (Windows 10), Board: "Arduino Uno"

sha1.cpp:21:6: error: 'Sha1Wrapper' has not been declared

void Sha1Wrapper::init(void)

  ^~~~~~~~~~~

C:\Duino\Arduino_Code\sha1.cpp: In function 'void init()':

sha1.cpp:23:20: error: '_hasher' was not declared in this scope

sha1_hasher_init(&_hasher);

                ^~~~~~~

C:\Duino\Arduino_Code\sha1.cpp: At global scope:

sha1.cpp:27:6: error: 'Sha1Wrapper' has not been declared

void Sha1Wrapper::initHmac(const uint8_t * secret, unsigned int secretLength)

  ^~~~~~~~~~~

C:\Duino\Arduino_Code\sha1.cpp: In function 'void initHmac(const uint8_t*, unsigned int)':

sha1.cpp:29:25: error: '_hasher' was not declared in this scope

sha1_hasher_init_hmac(&_hasher, secret, secretLength);

                     ^~~~~~~

C:\Duino\Arduino_Code\sha1.cpp: At global scope:

sha1.cpp:32:11: error: 'Sha1Wrapper' has not been declared

uint8_t * Sha1Wrapper::resultHmac(void)

       ^~~~~~~~~~~

C:\Duino\Arduino_Code\sha1.cpp: In function 'uint8_t* resultHmac()':

sha1.cpp:34:30: error: '_hasher' was not declared in this scope

return sha1_hasher_gethmac(&_hasher);

                          ^~~~~~~

C:\Duino\Arduino_Code\sha1.cpp: At global scope:

sha1.cpp:39:8: error: 'Sha1Wrapper' has not been declared

size_t Sha1Wrapper::write(uint8_t byte)

    ^~~~~~~~~~~

C:\Duino\Arduino_Code\sha1.cpp: In function 'size_t write(uint8_t)':

sha1.cpp:41:23: error: '_hasher' was not declared in this scope

if(sha1_hasher_putc(&_hasher, byte) == byte)

                   ^~~~~~~

C:\Duino\Arduino_Code\sha1.cpp: At global scope:

sha1.cpp:48:11: error: 'Sha1Wrapper' has not been declared

uint8_t * Sha1Wrapper::result(void)

       ^~~~~~~~~~~

C:\Duino\Arduino_Code\sha1.cpp: In function 'uint8_t* result()':

sha1.cpp:50:30: error: '_hasher' was not declared in this scope

return sha1_hasher_gethash(&_hasher);

                          ^~~~~~~

C:\Duino\Arduino_Code\sha1.cpp: At global scope:

sha1.cpp:53:1: error: 'Sha1Wrapper' does not name a type

Sha1Wrapper Sha1;

^~~~~~~~~~~

C:\Duino\Arduino_Code\Arduino_Code.ino: In function 'int ducos1a(String, String, int)':

Arduino_Code:65:5: error: 'Sha1' was not declared in this scope

 Sha1.init();

 ^~~~

C:\Duino\Arduino_Code\Arduino_Code.ino:65:5: note: suggested alternative: 'SPR1'

 Sha1.init();

 ^~~~

 SPR1

exit status 1

'Sha1Wrapper' has not been declared

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

jaybrown47 avatar May 19 '21 11:05 jaybrown47

Do you have the sha1 files in the same directory as Arduino_code.ino?

revoxhere avatar May 19 '21 11:05 revoxhere

Yeah all there. They appear in the ide also along the top.

jaybrown47 avatar May 19 '21 11:05 jaybrown47

Can you check the compilation on Arduino IDE 1.8.13?

revoxhere avatar May 19 '21 11:05 revoxhere

2 mins, Thank you, Apricate the help

jaybrown47 avatar May 19 '21 11:05 jaybrown47

Same issue

jaybrown47 avatar May 19 '21 11:05 jaybrown47

sha1.cpp:21:6: error: 'Sha1Wrapper' has not been declared void Sha1Wrapper::init(void) ^~~~~~~~~~~ sketch\sha1.cpp: In function 'void init()': sha1.cpp:23:20: error: '_hasher' was not declared in this scope sha1_hasher_init(&_hasher); ^~~~~~~ sketch\sha1.cpp: At global scope: sha1.cpp:27:6: error: 'Sha1Wrapper' has not been declared void Sha1Wrapper::initHmac(const uint8_t * secret, unsigned int secretLength) ^~~~~~~~~~~ sketch\sha1.cpp: In function 'void initHmac(const uint8_t*, unsigned int)': sha1.cpp:29:25: error: '_hasher' was not declared in this scope sha1_hasher_init_hmac(&_hasher, secret, secretLength); ^~~~~~~ sketch\sha1.cpp: At global scope: sha1.cpp:32:11: error: 'Sha1Wrapper' has not been declared uint8_t * Sha1Wrapper::resultHmac(void) ^~~~~~~~~~~ sketch\sha1.cpp: In function 'uint8_t* resultHmac()': sha1.cpp:34:30: error: '_hasher' was not declared in this scope return sha1_hasher_gethmac(&_hasher); ^~~~~~~ sketch\sha1.cpp: At global scope: sha1.cpp:39:8: error: 'Sha1Wrapper' has not been declared size_t Sha1Wrapper::write(uint8_t byte) ^~~~~~~~~~~ sketch\sha1.cpp: In function 'size_t write(uint8_t)': sha1.cpp:41:23: error: '_hasher' was not declared in this scope if(sha1_hasher_putc(&_hasher, byte) == byte) ^~~~~~~ sketch\sha1.cpp: At global scope: sha1.cpp:48:11: error: 'Sha1Wrapper' has not been declared uint8_t * Sha1Wrapper::result(void) ^~~~~~~~~~~ sketch\sha1.cpp: In function 'uint8_t* result()': sha1.cpp:50:30: error: '_hasher' was not declared in this scope return sha1_hasher_gethash(&_hasher); ^~~~~~~ sketch\sha1.cpp: At global scope: sha1.cpp:53:1: error: 'Sha1Wrapper' does not name a type Sha1Wrapper Sha1; ^~~~~~~~~~~ C:\Duino\Arduino_Code\Arduino_Code.ino: In function 'int ducos1a(String, String, int)': Arduino_Code:65:5: error: 'Sha1' was not declared in this scope Sha1.init(); ^~~~ C:\Duino\Arduino_Code\Arduino_Code.ino:65:5: note: suggested alternative: 'SPR1' Sha1.init(); ^~~~ SPR1 exit status 1 'Sha1Wrapper' has not been declared

jaybrown47 avatar May 19 '21 11:05 jaybrown47

Do you have any other sha libraries that may interfere with our one?

revoxhere avatar May 19 '21 11:05 revoxhere

Try installing the cryptosuite library maybe. https://daknuett.github.io/cryptosuite2/readme.html#install Not sure if that's gonna solve it but it's worth a try

MPM1107 avatar May 19 '21 12:05 MPM1107

I didnt, but have just tried cryptosuite... no luck either

jaybrown47 avatar May 19 '21 12:05 jaybrown47

Ive now removed cryptosuite again

jaybrown47 avatar May 19 '21 12:05 jaybrown47

I just pulled the code from github and it compiled w/o issue. I suspect you've got a library collision or something going on.

kickshawprogrammer avatar May 19 '21 13:05 kickshawprogrammer

Fixed it.

jaybrown47 avatar May 19 '21 15:05 jaybrown47