Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Build Fails when including Ethernet.h (Read 1582 times)
Dave Enyart
Newbies
*
Offline


Posts: 2
Joined: Aug 3rd, 2018
Build Fails when including Ethernet.h
Aug 3rd, 2018 at 10:26pm
Print Post  
I have just added the sunfounder W5100 ethernet shield to my project, and have added the required libraries.
Code (C++)
Select All
#include <SPI.h>
#include <Ethernet.h> 


When i try to build my sketch i get the following output the build
Code
Select All
Compiling 'Sketch1' for 'Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)'

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetUDP::peek()
ccOXjFhm.ltrans0.o*: (.text+0x282): undefined reference to peek(unsigned char, unsigned char*)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetClient::peek()
ccOXjFhm.ltrans0.o*: (.text+0x2c4): undefined reference to peek(unsigned char, unsigned char*)


Error linking for board Arduino/Genuino Mega w/ ATmega2560 (Mega 2560)
ccOXjFhm.ltrans0.ltrans.o*: In function EthernetUDP::read(unsigned char*, unsigned int)
ccOXjFhm.ltrans0.o*: (.text+0x300): undefined reference to recv(unsigned char, unsigned char*, int)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetUDP::read()
ccOXjFhm.ltrans0.o*: (.text+0x342): undefined reference to recv(unsigned char, unsigned char*, int)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetClient::read(unsigned char*, unsigned int)
ccOXjFhm.ltrans0.o*: (.text+0x372): undefined reference to recv(unsigned char, unsigned char*, int)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetClient::read()
ccOXjFhm.ltrans0.o*: (.text+0x38e): undefined reference to recv(unsigned char, unsigned char*, int)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetClient::available()
ccOXjFhm.ltrans0.o*: (.text+0x3b2): undefined reference to recvAvailable(unsigned char)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetUDP::parsePacket()
ccOXjFhm.ltrans0.o*: (.text+0x3f4): undefined reference to recvAvailable(unsigned char)
ccOXjFhm.ltrans0.o*: (.text+0x40e): undefined reference to recv(unsigned char, unsigned char*, int)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetUDP::write(unsigned char const*, unsigned int)
ccOXjFhm.ltrans0.o*: (.text+0x480): undefined reference to bufferData(unsigned char, unsigned int, unsigned char const*, unsigned int)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetUDP::endPacket()
ccOXjFhm.ltrans0.o*: (.text+0x49a): undefined reference to sendUDP(unsigned char)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetUDP::beginPacket(IPAddress, unsigned int)
ccOXjFhm.ltrans0.o*: (.text+0x4aa): undefined reference to startUDP(unsigned char, unsigned char*, unsigned int)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetUDP::stop()
ccOXjFhm.ltrans0.o*: (.text+0x4ba): undefined reference to close(unsigned char)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetUDP::begin(unsigned int)
ccOXjFhm.ltrans0.o*: (.text+0x4f6): undefined reference to socketStatus(unsigned char)
ccOXjFhm.ltrans0.o*: (.text+0x520): undefined reference to socket(unsigned char, unsigned char, unsigned int, unsigned char)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetClient::flush()
ccOXjFhm.ltrans0.o*: (.text+0x536): undefined reference to flush(unsigned char)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetClient::write(unsigned char const*, unsigned int)
ccOXjFhm.ltrans0.o*: (.text+0x560): undefined reference to send(unsigned char, unsigned char const*, unsigned int)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetUDP::beginMulticast(IPAddress, unsigned int)
ccOXjFhm.ltrans0.o*: (.text+0x100a): undefined reference to socket(unsigned char, unsigned char, unsigned int, unsigned char)
ccOXjFhm.ltrans0.o*: (.text+0x1042): undefined reference to socketStatus(unsigned char)
ccOXjFhm.ltrans0.o*: (.text+0x10b4): undefined reference to socket(unsigned char, unsigned char, unsigned int, unsigned char)
ccOXjFhm.ltrans0.o*: (.text+0x10ba): undefined reference to listen(unsigned char)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetServer::begin()
ccOXjFhm.ltrans0.o*: (.text+0x115e): undefined reference to disconnect(unsigned char)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetClient::connected()
ccOXjFhm.ltrans0.o*: (.text+0x1198): undefined reference to close(unsigned char)

ccOXjFhm.ltrans0.ltrans.o*: In function EthernetServer::write(unsigned char const*, unsigned int)
ccOXjFhm.ltrans0.o*: (.text+0x13a8): undefined reference to socketStatus(unsigned char)
ccOXjFhm.ltrans0.o*: (.text+0x13ee): undefined reference to socket(unsigned char, unsigned char, unsigned int, unsigned char)
ccOXjFhm.ltrans0.o*: (.text+0x13fc): undefined reference to connect(unsigned char, unsigned char*, unsigned int)

collect2.exe*: error: ld returned 1 exit status
Build failed for project 'Sketch1' 



This will not build or run.
No other code was added to project.

I have also tried the same code in the Arduino IDE and it builds just fine and runs.
I'm at a loss and looking for any suggestions.

Visual Studio Version: 15.7.5
vMirco Version: 1807.8.0
Arduino IDE version:1.8.5
Under manage Libraries I do see Ethernet 2.0.0 by various listed
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Build Fails when including Ethernet.h
Reply #1 - Aug 4th, 2018 at 10:51am
Print Post  
please switch on vmicro>compile>verbose and show build properties. then build and copy the output into a .txt and email to info[at]visualmicro.com along with a link to this post. In arduino ide switch on file>preferences>verbose compile. then build and also include the output as a .txt in the email

Thanks
  
Back to top
IP Logged
 
Dave Enyart
Newbies
*
Offline


Posts: 2
Joined: Aug 3rd, 2018
Re: Build Fails when including Ethernet.h
Reply #2 - Aug 21st, 2018 at 9:25pm
Print Post  
I am still receiving this error.
I thought I had it beat, but alas it has come back.
I have email the files you requested but have not heard anything back as of yet. Any info you can provide would be quite helpful.
Thank you
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint