Jump to content
OGXbox.com

error trying to compile spi2par2019.ino


Johny white
 Share

Recommended Posts

Got an open xenium board which I wanted to add LCD with when installing, already ordered daughter board for spi2par2019 and on its way through UPS. While waiting for this, I thought I'd compile and upload spi2par2019.ino to the Arduino Pro Micro Leonardo board I got but getting the following error towards the end of the compilation.

 


C:\Users\amr\AppData\Local\Temp\cc9DUfI4.ltrans0.ltrans.o: In function `readSMBus(unsigned char, unsigned char, char*, unsigned char)':
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:474: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:474: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:474: undefined reference to `TwoWire::beginTransmission(unsigned char)'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:475: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:475: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:475: undefined reference to `TwoWire::write(unsigned char)'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:476: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:476: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:476: undefined reference to `TwoWire::endTransmission(unsigned char)'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:477: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:477: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:477: undefined reference to `TwoWire::requestFrom(unsigned char, unsigned char)'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `TwoWire::read()'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `TwoWire::read()'
C:\Users\amr\AppData\Local\Temp\cc9DUfI4.ltrans0.ltrans.o: In function `setup':
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:94: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:94: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:94: undefined reference to `TwoWire::begin(int)'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Leonardo.

 

Edited by Johny white
Link to comment
Share on other sites

4 hours ago, Johny white said:

Got an open xenium board which I wanted to add LCD with when installing, already ordered daughter board for spi2par2019 and on its way through UPS. While waiting for this, I thought I'd compile and upload spi2par2019.ino to the Arduino Pro Micro Leonardo board I got but getting the following error towards the end of the compilation.

 


C:\Users\amr\AppData\Local\Temp\cc9DUfI4.ltrans0.ltrans.o: In function `readSMBus(unsigned char, unsigned char, char*, unsigned char)':
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:474: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:474: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:474: undefined reference to `TwoWire::beginTransmission(unsigned char)'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:475: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:475: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:475: undefined reference to `TwoWire::write(unsigned char)'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:476: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:476: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:476: undefined reference to `TwoWire::endTransmission(unsigned char)'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:477: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:477: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:477: undefined reference to `TwoWire::requestFrom(unsigned char, unsigned char)'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `TwoWire::read()'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:479: undefined reference to `TwoWire::read()'
C:\Users\amr\AppData\Local\Temp\cc9DUfI4.ltrans0.ltrans.o: In function `setup':
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:94: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:94: undefined reference to `Wire'
C:\Users\amr\Downloads\spi2par2019/spi2par2019.ino:94: undefined reference to `TwoWire::begin(int)'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Leonardo.

 

Do you have the src subfolder with all its content from the spi2par2019 github repository in the sketch folder when trying to compile spi2par2019.ino?

I believe that folder includes the code to use the Wire library. 

When I compiled spi2par2019, I received a few different errors than you but they did not prevent the sketch from compiling:



C:\Users\KaosEngineer\Documents\Arduino\spi2par2019\src\SMWire\utility\twi.c: In function '__vector_36':
C:\Users\KaosEngineer\Documents\Arduino\spi2par2019\src\SMWire\utility\twi.c:541:1: warning: useless type name in empty declaration
 extern unsigned char ;
 ^~~~~~
Sketch uses 11188 bytes (39%) of program storage space. Maximum is 28672 bytes.
Global variables use 1061 bytes (41%) of dynamic memory, leaving 1499 bytes for local variables. Maximum is 2560 bytes.

All of the highlighted files and folders need to be present from the repository in the location you load the spi2par2019.ino file from:image.png.b208308c217eafbd356ebc32876680c7.png

The src folder contains the code to use the Wire function(s).

Link to comment
Share on other sites

7 hours ago, KaosEngineer said:

Do you have the src subfolder with all its content from the spi2par2019 github repository in the sketch folder when trying to compile spi2par2019.ino?

I believe that folder includes the code to use the Wire library. 

When I compiled spi2par2019, I received a few different errors than you but they did not prevent the sketch from compiling:

C:\Users\KaosEngineer\Documents\Arduino\spi2par2019\src\SMWire\utility\twi.c: In function '__vector_36':
C:\Users\KaosEngineer\Documents\Arduino\spi2par2019\src\SMWire\utility\twi.c:541:1: warning: useless type name in empty declaration
 extern unsigned char ;
 ^~~~~~
Sketch uses 11188 bytes (39%) of program storage space. Maximum is 28672 bytes.
Global variables use 1061 bytes (41%) of dynamic memory, leaving 1499 bytes for local variables. Maximum is 2560 bytes.

All of the highlighted files and folders need to be present from the repository in the location you load the spi2par2019.ino file from:image.png.b208308c217eafbd356ebc32876680c7.png

The src folder contains the code to use the Wire function(s).

May be I'm just been blind, is there a download link for the whole repositery? Everytime it gave me a different error, I copied the text of the missing file, pasted into note pad and created it but I cannot find a download for the whole files needed in one place!!!

Link to comment
Share on other sites

5 minutes ago, Johny white said:

May be I'm just been blind, is there a download link for the whole repositery? Everytime it gave me a different error, I copied the text of the missing file, pasted into note pad and created it but I cannot find a download for the whole files needed in one place!!!

Click on the green box called code the you can download the whole lot as a zip file

 

Capture111.jpg

 

 

Cheers

SS Dave


Soft modding is like masturbating, It gets the job done but it's nothing like the real thing.

 

  • Like 1
Link to comment
Share on other sites

27 minutes ago, Johny white said:

May be I'm just been blind, is there a download link for the whole repositery? Everytime it gave me a different error, I copied the text of the missing file, pasted into note pad and created it but I cannot find a download for the whole files needed in one place!!!

Click the Code button to display the dropdown menu.  Next, click on Download ZIP.  This action will download all of the files in the spi2par2019 repository in a ZIP archive file for the selected branch.  For this repository, there's only one branch - named master.  The zip archive will be named <repository name>-<branch name>.zip -> spi2par2019-master.zip.

github repositoy Download ZIP for master branch - Screenshot 2021-10-01 035142.png

Link to comment
Share on other sites

24 minutes ago, SS_Dave said:

Click on the green box called code the you can download the whole lot as a zip file

 

Capture111.jpg

 

 

Cheers

SS Dave


Soft modding is like masturbating, It gets the job done but it's nothing like the real thing.

 

I see you beat me to it.  I had not read your post before I replied. So, the answer is posted twice. :)

Link to comment
Share on other sites

43 minutes ago, Johny white said:

Thanks guys, downloaded this and ran it again, this time its giving me less and different errors but its saying its compiled. Is that good to go and upload or I'm still doing something wrong?

Capture.PNG

Those are the same warnings that I saw.  I believe the code has been compiled and is ready to be uploaded to the Arduino Leonardo.

 

Edit: I opened the Arduino IDE again and recompiled the code.  This time those error lines did not appear.  Weird...

Link to comment
Share on other sites

16 minutes ago, KaosEngineer said:

Those are the same warnings that I saw.  I believe the code has been compiled and is ready to be uploaded to the Arduino Leonardo.

 

Edit: I opened the Arduino IDE again and recompiled the code.  This time those error lines did not appear.  Weird...

Very odd indeed, I moved the sketch folder up one level. Open and recompiled few times, at first it gave the same error but now it's not giving it anymore.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

Board Life Status


Board startup date: April 23, 2017 12:45:48
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.