"WiFi does not name a type" error for Arduino Yun

I'm having trouble with this code the library was built into the Arduino so I didn't have to upload it myself I have no access to the folder its in its hidden from me and I have no idea how to get to it but I assume its set up correctly because the Arduino came with it and I have been having trouble finding a forum that can help me because most say to either move the folder its in or to make sure its installed correctly.

this is my code

#include <TextFinder.h>
#include <Bridge.h>
#include <WiFi.h>
#include <WiFiServer.h>
WiFiClient client; //Creates a client that can connect to to a specified internet IP address and port as defined in client.connect().

//client.connect("192.168.240.1/sd/serial")// it looks like you have to have an if else statement to go with this 

WiFi.begin("Arduino Yun-90A2DAF50109","arduino")//starts the librarys prosses

void setup() {

  // put your setup code here, to run once:
  //if statement must be with in either set up or loop

if(client.connect("192.168.240.1/sd/serial")){
  Console.println("conected");}

else {
  Console.println("not conected")}
}

wifi.begin() is the line that is highlighted in red when I compile it

I figured it out it turns out that you have to put the WiFi.begin() under the void setup() otherwise you get this error

That solution didn't work for me

The WiFi.h and WiFiServer.h libraries do not work with the Yun - they are designed for a typical Arduino with a WiFi shield. Networking on the Yun is completely different.

On the Yun, use the BridgeServer and BridgeClient classes that are part of the Bridge Library, or the HttpClient class that is also part of the Bridge library. Or implement your network services on the Linux side (more difficult, but much more powerful) and use the Process class in your sketch to pass data between thvsketch and the Linux side.)