IDE picks wrong library, at lease not the one I want

Again, this one has been well addressed but no solution apparent to me.
Using Uno Wifi Rev.2 board

I’m trying to persuade the Windows 10 Arduino IDE App to load the
#include <WifiNINA.h> // so I can ping localServers and webHosts
but instead the compiler says:
Arduino_UNO_WiFi_VM:120:28: error: ‘class WiFiClass’ has no member named ‘ping’
localserverResult = WiFi.ping(localServer);
^~~~
Multiple libraries were found for “WiFi.h” (which BTW, I commented out so don’t know how it even sees WiFi.h)
Used: C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt\libraries\WiFi
Not used: C:\Users\Dana\OneDrive\Documents\Arduino\libraries\WiFiNINA
exit status 1
‘class WiFiClass’ has no member named ‘ping’

It’s loading it’s own library instead of the one I want loaded. So I tried to find and delete the one it’s loading by navigating to the location where the file is located. However WindowsApps is a hidden file and protected against me as System Administrator from even read access. So I can’t delete the library. I found a post from Pert instructing to put in the path name. None of these #include work:
#include
“C:\Users\Dana\OneDrive\Documents\Arduino\libraries\WiFiNINA”
“C:\Users\Dana\OneDrive\Documents\Arduino\libraries\WiFiNINA\examples”
“C:\Users\Dana\OneDrive\Documents\Arduino\libraries\WiFiNINA\examples\WiFiPing”
“C:\Users\Dana\OneDrive\Documents\Arduino\libraries\WiFiNINA\examples\WiFiPing\arduino_secrets.h”

How do I force the IDE to choose the library I want?
Also tried to move the WiFiNINA library to the default library but having trouble with permission. It won’t let me write to the default libraries even after I changed all the permissions I dare to change to Full Access for almost every class of user.

Then I tried to point the IDE to a different folder to look for libraries. Also not possible apparently. I see not a way in the IDE or in Preferences to have it look in a different folder for libraries.

Nevermind, I finally figured it out. For those who might have same problem which result from having two installations of the Arduino IDE I think. Where the Library manager installs the new library where it wants but the Arduino IDE (in my case anyway) is executing out of C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.42.0_x86__mdqgnx93n4wtt folder, which you can’t modify because of insufficient permissions. Anyway it’s not the place to add user libraries. You need to create a new libraries folder for user libraries.
Create a libraries folder in your Sketches folder witch is inside your Arduino folder which is inside your documents folder. Why it got installed there, I don’t know. Here’s my path
C:\Users\Dana\OneDrive\Documents\Arduino\Sketches Ignore like it’s not there, the OneDrive thing. It’s really on my PC in the Documents folder but Microsoft insists on backing everything up to OneDrive automatically so it’s in both places and when I explicitly navigate to the Documents folder on the C:\ it still shows OneDrive in the path name.

Copy the library folder you want to use and paste it into the new libraries folder you just created. While this does leave two copies of the library on your machine it has not caused a “multiple files” fault in the compiler. Then use the IDE menu Sketch: Include Library then select the library you just added and it will automatically enter the proper #include to your sketch.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.