Include returning error

I am trying to use this to get my wishield connected to my network, and return the visitors (gave up on the temp measuring for now, since it totally makes the wishield stall)

But all i am getting is

22: error: WiServer.h: No such file or directory In function 'boolean sendMyPage(char*)':
 In function 'void setup()':
 In function 'void loop()':

when i try to verify it...

I tried to put the file into the same dir as the other file, removing the <>, tried to move the files around in the library folder, still same error...

How the beep do i make it include that file???

/*
 * A simple sketch that uses WiServer to serve a web page
 * and an lcd to show status and hits
 */

#include <WiServer.h>

// page hit count
int count = 0;

#define WIRELESS_MODE_INFRA      1
#define WIRELESS_MODE_ADHOC      2

// Wireless configuration parameters ----------------------------------------
unsigned char local_ip[] = {192,168,1,10};      // IP address of WiShield
unsigned char gateway_ip[] = {192,168,1,1};      // router or gateway IP address
unsigned char subnet_mask[] = {255,255,255,0};      // subnet mask for the local network
const prog_char ssid[] PROGMEM = {"dd-wrt"};            // max 32 bytes

unsigned char security_type = 3;      // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2

// WPA/WPA2 passphrase
const prog_char security_passphrase[] PROGMEM = {"xxxxxxxxxxxxxxxx"};      // max 64 characters

// WEP 128-bit keys
// sample HEX keys
prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d,      // Key 0
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      // Key 1
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,      // Key 2
                          0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00      // Key 3
                        };

// setup the wireless mode
// infrastructure - connect to AP
// adhoc - connect to another WiFi device
unsigned char wireless_mode = WIRELESS_MODE_INFRA;

unsigned char ssid_len;
unsigned char security_passphrase_len;
// End of wireless configuration parameters ----------------------------------------

// This is our page serving function that generates web pages
boolean sendMyPage(char* URL) {

    // Check if the requested URL sets bleeper on
    if (strcmp(URL, "/") == 0) {

        // Use WiServer's print and println functions to write out the page content
        WiServer.print("<html>");
        WiServer.print("Hello world
");
        WiServer.print(count);
        WiServer.print(" Hits");
        WiServer.print("</html>");
        count++;
        return true;
    }

    // URL not found
    return false;
}


void setup() {
  // Initialize WiServer and have it use the sendMyPage function to serve pages
  WiServer.init(sendMyPage);
}

void loop(){

  // Run WiServer
  WiServer.server_task();
  //Serial.print("Loop");
}

Where does WiServer.h live? It, apparently, is not in any of the places that the Arduino IDE is looking for it.

Which version of the IDE are you using?

How the beep do i make it include that file???

You put the *beeping" file in the right beeping place on the hard drive.

And where would that place be? :wink:

Apparently not in the same folder with " " surrounding the name, and not in the library folder, or in a sub folder with < > surrounding the name...

Moved the files around for over an hour now, without figuring out where to put them.

The file needs to be named WiServer.h, with no " or < or > any where in sight.

Where it goes depends on the version of the Arduino IDE that you are using. I asked that earlier...

Using 0018

the "" and <> was where it included it, saw something about it should be " " if it was a file located outside the library and < > if it was inside

You use #include "HeaderName.h" if the file is in the same directory as the sketch. You use "include <HeaderName.h> if the include file is in some other (findable) location.

For Arduino 18, there is a directory call libraries in the same directory as arduino.exe (wherever you installed Arduino 0018). In that directory, there are folders for each of the libraries. There should be a WiServer folder there, that contains WiServer.h.

Must be the path the program was located in that confused it.

I moved it to E:\Arduino and now seems to include the file, but now got some new errors instead

o: In function `loop':
C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:75: undefined reference to `WiServer'

C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:75: undefined reference to `WiServer'

C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:75: undefined reference to `Server::server_task()'

o: In function `setup':
C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:69: undefined reference to `WiServer'

C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:69: undefined reference to `WiServer'

C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:69: undefined reference to `Server::init(unsigned char (*)(char*))'

o: In function `sendMyPage(char*)':
C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:53: undefined reference to `WiServer'

C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:53: undefined reference to `WiServer'

C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:54: undefined reference to `WiServer'

C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:54: undefined reference to `WiServer'

C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:55: undefined reference to `WiServer'

o:C:\Users\Parx\AppData\Local\Temp\build5166388504300975598.tmp/miniWebserver.cpp:55: more undefined references to `WiServer' follow

The WiServer.h is located in E:\Arduino\libraries\WiShield

if i rename that folder to WiServer, it instead gives me this error

java.lang.NullPointerException
      at processing.app.debug.Compiler.contentsToClassPath(Compiler.java:630)
      at processing.app.Sketch.preprocess(Sketch.java:1362)
      at processing.app.Sketch.preprocess(Sketch.java:1226)
      at processing.app.Sketch.build(Sketch.java:1407)
      at processing.app.Sketch.compile(Sketch.java:1203)
      at processing.app.Editor$44.run(Editor.java:1807)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

if I do #include <WiShield/WiServer.h> it then returns that the file cant be found again, so #include <WiServer.h> must be finding the file, but unable to use it?

Don't go renaming things. The names assigned were chosen for a reason.

What does your sketch look like?

I got what I posted in the first post, do I need more than just that?

See here: http://asynclabs.com/forums/viewtopic.php?f=15&t=171&p=973&hilit=undefined#p973

!c

aaaah great!

had to edit the apps-conf, got it working now :slight_smile:

Thank you, both :slight_smile: