no matching function to call for HttpClient

Hello,
Please could somebody explain to me why i get the error “no matching function to call for HttpClient::HttpClient()” (when compiling)
Perhaps it’s because the EthernetClient is also named as client. if somebody could explain to me what I need to understand to get through this problem it would be much appreciated.

#include <Ethernet.h>
#include <HttpClient.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 0, 68);

void setup() {
EthernetClient client;

// Start Ehternet
  Ethernet.begin(mac,ip);
  
//  client.connect();
  delay(1000);
 
// Start Serial Port
  Serial.begin(9600);
  
// Check Ethernet
  Serial.println("Setup...");
  Serial.println("ip is: ");
  Serial.println(Ethernet.localIP());
  Serial.println("DNS is: ");
  Serial.println(Ethernet.dnsServerIP());
  Serial.println("Ethernet Hardward Status is: ");

if (Ethernet.hardwareStatus() == 1) {
    Serial.println("W5100 Ethernet controller detected.");
   }
}


void loop() {
  
  // Initialize the client library
  HttpClient client;

  // Make a HTTP request:
  client.get("http://www.arduino.cc/asciilogo.txt");

  // if there are incoming bytes available from the server, read them and print them:
  
while (client.available()) {
    char c = client.read();
    Serial.print(c);
  }
  Serial.flush();

  delay(5000);
}

Read the example. If this is this library You initialize an http client this way

 void loop()
{
  EthernetClient c;
  HttpClient http(c);
...

Compiles OK for me

Arduino Nano
IDE 1.8.13
Windows 10

What is your programming environment ?

Please post the full error message that you get using the "Copy error messages" button and pasting is here in code tags

Here is the error in full.
I was basing this on an example called HTTP Client. I will check out the other examples, but they seem more complex so i was hoping to begin with this one.
Thank you.

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


C:\Users\simon\Auduino_Sketches\TEMP\sketch_dec28a\sketch_dec28a.ino: In function 'void loop()':

sketch_dec28a:38:14: error: no matching function for call to 'HttpClient::HttpClient()'

   HttpClient client;

              ^~~~~~

In file included from C:\Users\simon\Auduino_Sketches\TEMP\sketch_dec28a\sketch_dec28a.ino:1:0:

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:50:5: note: candidate: HttpClient::HttpClient(Client&)

     HttpClient(Client& aClient);

     ^~~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:50:5: note:   candidate expects 1 argument, 0 provided

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:37:7: note: candidate: constexpr HttpClient::HttpClient(const HttpClient&)

 class HttpClient : public Client

       ^~~~~~~~~~

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:37:7: note:   candidate expects 1 argument, 0 provided

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:37:7: note: candidate: constexpr HttpClient::HttpClient(HttpClient&&)

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:37:7: note:   candidate expects 1 argument, 0 provided

sketch_dec28a:41:51: error: no matching function for call to 'HttpClient::get(const char [36])'

   client.get("http://www.arduino.cc/asciilogo.txt");

                                                   ^

In file included from C:\Users\simon\Auduino_Sketches\TEMP\sketch_dec28a\sketch_dec28a.ino:1:0:

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:74:9: note: candidate: int HttpClient::get(const char*, uint16_t, const char*, const char*)

     int get(const char* aServerName, uint16_t aServerPort, const char* aURLPath,

         ^~~

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:74:9: note:   candidate expects 4 arguments, 1 provided

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:86:9: note: candidate: int HttpClient::get(const char*, const char*, const char*)

     int get(const char* aServerName, const char* aURLPath, const char* aUserAgent =NULL)

         ^~~

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:86:9: note:   candidate expects 3 arguments, 1 provided

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:100:9: note: candidate: int HttpClient::get(const IPAddress&, const char*, uint16_t, const char*, const char*)

     int get(const IPAddress& aServerAddress,

         ^~~

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:100:9: note:   candidate expects 5 arguments, 1 provided

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:117:9: note: candidate: int HttpClient::get(const IPAddress&, const char*, const char*, const char*)

     int get(const IPAddress& aServerAddress,

         ^~~

C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0/HttpClient.h:117:9: note:   candidate expects 4 arguments, 1 provided

Multiple libraries were found for "HttpClient.h"

 Used: C:\Program Files (x86)\Arduino\libraries\HttpClientt-2.2.0

 Not used: C:\Program Files (x86)\Arduino\libraries\Bridge

exit status 1

no matching function for call to 'HttpClient::HttpClient()'



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

Your compiler believes that you are using an HttpClient class which does not have an empty constructor.
It tells you it expects one parameter HttpClient::HttpClient(Client&)==>cf comment #1

clarify which library you are trying to use please

it is this one; GitHub - amcewen/HttpClient: Arduino HTTP library

is it likely that more than one library exists with the name HttpClient? Perhaps that's obvious, but I have been assuming that all libraries with a given name would behave the same...

is it likely that more than one library exists with the name HttpClient?

I have been assuming that all libraries with a given name would behave the same...

Oh dear !

So go back to my answer #1 and check how they do it in their example

I went back, and used the example and things are working ok now, and i was able to move forward. thankyou.