how to modify a library

I am having a difficult time getting my Arduino to make an Ethernet connection (i.e., hangs on “Ethernet.begin(mac)”) and want to implement a change to the Dhcp.cpp library file recommended by someone else on this forum; however, they didn’t how to go about modifying a library file, but they rather simply told me what line to insert where.

Tried to google for the issue of how to modify a library file using the Arduino IDE, and found this – http://forum.arduino.cc/index.php/topic,37294.0.html. But it’s not working for me, i.e., I copy the .cpp and .h lib. files to my sketchbook directory and restart the IDE. Then I can only find the .cpp file from within the IDE by using the file/open menu (i.e., file is not in the sketchbook), and when I try to open it I get the message: “Processing can only its own sketches and other files ending in .ino or .pde”.

Once the above problem is solved, I’m still not sure how to compile the revised library file and ensure that it is the one that gets loaded.

Any suggestions on how to do this would be appreciated – as you can tell, it’s my first project!!

Find the source file that you want to change. For standard libraries shipped with the IDE, this will be under the libraries folder in the Arduino software installation directory. For libraries you have installed separately, these should have been installed in the libraries folder within the directory where your sketches are stored.

Open the file you want to change in your favorite text editor. If you don't have a favorite then use your default notepad editor. Save your changes. When you compile the sketch in the Arduino IDE, it will use whatever version of the library has been saved to disk at that time.

Before changing a library source file, I suggest you save a copy of the original file somewhere else so you can revert to it if necessary.

it's 2.9.5 version

But it's not working for me, i.e., I copy the .cpp and .h lib. files to my sketchbook directory and restart the IDE.

You are NOT supposed to COPY anything. Modify the library IN PLACE.