Trying to figure out where to put the support files.

When using an include with “” instead of <> means the support files like cpp and h files have to be in the same directory as the sketch ino file but, I’m having trouble when my sketch and support files are on a server and the IDE installation is on my C:\ drive. I like to keep my sketch on a server in case my local C:\ drive dies and I can also access the sketch from other computers. However, it seems some of my support files on the server are conflicting with the same support files on the C:\ drive with the IDE installation. What is the best way to deal with this?

However, it seems some of my support files on the server are conflicting with the same support files on the C:\ drive with the IDE installation. What is the best way to deal with this?

Hope that the magic fairy comes along and sprinkles blue pixie dust on the server.

If you REALLY want help, "it seems...conflicting" is rubbish. Explain EXACTLY what the problem is.

If you don't have the files where the IDE expects to see them you need to give full path names.

The fact that the IDE can't work with relative path names is a real PITA. The problem is due to the fact that the IDE does not work with your files where they are. Instead it copies everything to a temporary directory and compiles from there.

I use the Geany editor and I have written a simple Python program to compile and upload using the command-line IDE. The Python program converts relative references to absolute references.

...R

Here are the error messages that led me to believe there may be some conflicting support files. I don't think I have a good handle on the location of where I should save my custom sketch, the Examples in the IDE install, and the support files.

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/socket.h:10:0,

                 from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:30:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/w5500.h:17:0: warning: "MAX_SOCK_NUM" redefined

 #define MAX_SOCK_NUM 8

 ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:29:0:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/w5100.h:17:0: note: this is the location of the previous definition

 #define MAX_SOCK_NUM 4

 ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:31:0:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\Ethernet.h:11:0: warning: "MAX_SOCK_NUM" redefined

 #define MAX_SOCK_NUM 4

 ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/socket.h:10:0,

                 from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:30:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/w5500.h:17:0: note: this is the location of the previous definition

 #define MAX_SOCK_NUM 8

 ^

C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/w5500.h:47:7: error: redefinition of 'class SnMR'

 class SnMR {

       ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:29:0:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/w5100.h:50:7: error: previous definition of 'class SnMR'

 class SnMR {

       ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/socket.h:10:0,

                 from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:30:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/w5500.h:59:6: error: multiple definition of 'enum SockCMD'

 enum SockCMD {

      ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:29:0:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/w5100.h:62:6: error: previous definition here

 enum SockCMD {

      ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/socket.h:10:0,

                 from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:30:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/w5500.h:85:7: error: redefinition of 'class SnIR'

 class SnIR {

       ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:29:0:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/w5100.h:88:7: error: previous definition of 'class SnIR'

 class SnIR {

       ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/socket.h:10:0,

                 from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:30:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/w5500.h:94:7: error: redefinition of 'class SnSR'

 class SnSR {

       ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:29:0:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/w5100.h:97:7: error: previous definition of 'class SnSR'

 class SnSR {

       ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/socket.h:10:0,

                 from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:30:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src/utility/w5500.h:113:7: error: redefinition of 'class IPPROTO'

 class IPPROTO {

       ^

In file included from C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:29:0:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\utility/w5100.h:116:7: error: previous definition of 'class IPPROTO'

 class IPPROTO {

       ^

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp: In member function 'virtual uint8_t EthernetUDP::begin(uint16_t)':

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:44:31: error: 'socketStatus' was not declared in this scope

     uint8_t s = socketStatus(i);

                               ^

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp: In member function 'virtual int EthernetUDP::parsePacket()':

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:128:26: error: 'recvAvailable' was not declared in this scope

   if (recvAvailable(_sock) > 0)

                          ^

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp: At global scope:

C:\Program Files (x86)\Arduino\libraries\Ethernet\src\EthernetUdp.cpp:218:64: error: no 'uint8_t EthernetUDP::beginMulticast(IPAddress, uint16_t)' member function declared in class 'EthernetUDP'

 uint8_t EthernetUDP::beginMulticast(IPAddress ip, uint16_t port)

                                                                ^

exit status 1
Error compiling for board Arduino/Genuino Uno.

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

Can you make a simple example program (perhaps just a .ino file and one or two short additional files) that displays the problem and post all the files together with their full path names.

...R

I can get the Examples under the Arduino folder to work but, one complication I have when trying to use the Ethernet Examples under the library folder is that my actual Ethernet shield is a w5500 model instead of the typical w5100 model so I have to copy over some of the support files in the src and util folders.

my actual Ethernet shield is a w5500 model

i thought the W5500 shields used the "Ethernet2" library, which shouldn't conflict except in the unlikely event that you use both the Ethernet AND Ethernet2 libraries...

Bugman1400:
I can get the Examples under the Arduino folder to work but, ...

In case there is confusion when I used the word "example" in Reply #4 I was referring to a program you would write and not to the Example programs that come with the Arduino IDE.

...R

Bugman1400:
However, it seems some of my support files on the server are conflicting with the same support files on the C:\ drive with the IDE installation.

Did you even look at the error messages? All the conflicts are coming from the same library.

Bugman1400:
so I have to copy over some of the support files in the src and util folders.

And here we have the true cause of the problem, which you should have mentioned from the start. You needed to install the W5500 supporting Ethernet library in its entirety, not drop it in on top of the standard Ethernet library. As westfw said, the easiest way is to use the Ethernet2 library:

  • Sketch > Include Library > Manage Libraries...
  • Wait for download to finish
  • In the "Filter your search..." box, type "ethernet2"
  • Click on the "Ethernet2" entry.
  • Click "Install"
  • Wait for installation to finish.
  • Click "Close".
  • Now change any instance of Ethernet.h in your includes to Ethernet2.h and any instance of EthernetUdp.h to EthernetUdp2.h.

There are some other (perhaps superior) options for libraries that support W5500 but the Ethernet2 is the easiest to install and I think easy is the way to go in this case.

When I initially got the w5500, I had problems using it with existing sketches that called out a w5100. I posted my issues and was instructed to replace anything w5100 with w5500. It seemed to work at the time. I am still learning so, many of the error messages don’t make sense but, I am starting to understand them more through these informative posts.