# My Library Is Not Working!

**URL:** <https://forum.arduino.cc/t/my-library-is-not-working/407218>\
**Category:** Programming\
**Created:** [September 10, 2016, 10:57pm UTC](https://forum.arduino.cc/t/my-library-is-not-working/407218 "2016-09-10T22:57:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reedsmout](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@Reedsmout](https://forum.arduino.cc/u/Reedsmout)\
**Post date:** [September 10, 2016, 10:57pm UTC](https://forum.arduino.cc/t/my-library-is-not-working/407218/1 "2016-09-10T22:57:52Z")

</div>

I am trying to make a library which will make my complicated code easier to read and make new programs out of. But when I verify my library, it throws up an error:

```cpp
exit status 1
request for member 'Listen123' in 'robocar123', which is of non-class type 'Robocar()'

```

Can anybody help?

I've probably done something really dumb, but for the life of me I can't figure it out.

[Robocar.cpp](https://forum.arduino.cc/uploads/short-url/563frmC2tagxanyk5qVcytQii20.cpp) (3.93 KB)

[Robocar.h](https://forum.arduino.cc/uploads/short-url/eMbZzAGJDDBQIab2ZqMo7U5Gguv.h) (406 Bytes)

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [September 12, 2016, 1:47am UTC](https://forum.arduino.cc/t/my-library-is-not-working/407218/2 "2016-09-12T01:47:39Z")

</div>

Sounds like your sketch has declared something wrong. What does your sketch say? What is the full error message?

This is what I get when I try to include your library in the minimal sketch:

```cpp
In file included from /Users/john/Documents/Arduino/sketch_sep11b/sketch_sep11b.ino:1:0:
/Users/john/Documents/Arduino/libraries/Robocar/Robocar.h:4:20: fatal error: EasyVR.h: No such file or directory
 #include <EasyVR.h>
                    ^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

```

---

<div class="post-metadata">

**Author:** ![PaulMurrayCbr](https://avatars.discourse-cdn.com/v4/letter/p/74df32/32.png) [@PaulMurrayCbr](https://forum.arduino.cc/u/PaulMurrayCbr)\
**Post date:** [September 12, 2016, 3:11am UTC](https://forum.arduino.cc/t/my-library-is-not-working/407218/3 "2016-09-12T03:11:46Z")

</div>

> Reedsmout:  
> class Robocar {  
> public:  
> void Setup();  
> void Listen();

Methods and variables conventionally start with a lowercase letter, types start with an uppercase.

If your "listen" method does what I think it does, I usually call that method "loop()" because arduino programmers are probably familiar with the idea.

It's a good idea to bracket your debugging output with

```arduino
#ifdef DEBUG
  Serial.println(:my debigging");
#endif

```

and to `#define DEBUG` at the top of the .h file.

But as to your bug: the class "Robocar" does not have a method named "Listen123". If you have a variable of type Robocar named robocar123, then you invoke its listen method as `robocar123.Listen()`.

---

<div class="post-metadata">

**Author:** ![johnwasser](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/johnwasser/32/214270_2.png) [@johnwasser](https://forum.arduino.cc/u/johnwasser)\
**Post date:** [September 12, 2016, 11:10am UTC](https://forum.arduino.cc/t/my-library-is-not-working/407218/4 "2016-09-12T11:10:55Z")

</div>

Your library compiles fine (only one warning) with this sketch:

```cpp
#include "Robocar.h"

Robocar robocar123;

void setup() {
  // put your setup code here, to run once:
  robocar123.Setup();
}

void loop() {
  // put your main code here, to run repeatedly:
  robocar123.Listen();
}

```

The warning is:

```cpp
/Applications/Arduino 1.6.10.app/Contents/Java/libraries/Servo/src/avr/Servo.cpp:184:39: warning: unused parameter 'timer' [-Wunused-parameter]
 static void finISR(timer16_Sequence_t timer)
                                       ^

```

If that function is used as an ISR it should have no arguments.

---

<div class="post-metadata">

**Author:** ![Reedsmout](https://avatars.discourse-cdn.com/v4/letter/r/f04885/32.png) [@Reedsmout](https://forum.arduino.cc/u/Reedsmout)\
**Post date:** [October 9, 2016, 2:01am UTC](https://forum.arduino.cc/t/my-library-is-not-working/407218/5 "2016-10-09T02:01:39Z")

</div>

Thanks for that everyone, It turns out I solved it with different methods, but thanks for all the help!

---

<div class="post-metadata">

**Author:** ![julyjim](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@julyjim](https://forum.arduino.cc/u/julyjim)\
**Post date:** [October 9, 2016, 2:26am UTC](https://forum.arduino.cc/t/my-library-is-not-working/407218/6 "2016-10-09T02:26:59Z")

</div>

> Reedsmout:  
> I am trying to make a library which will make my complicated code easier to read and make new programs out of. But when I verify my library, it throws up an error:
> 
> ```arduino
> exit status 1
> 
> ```

request for member 'Listen123' in 'robocar123', which is of non-class type 'Robocar()'

> ```arduino
> 
> Can anybody help?
> 
> I've probably done something really dumb, but for the life of me I can't figure it out.
> 
> ```

Nope nothing dumb about it , the compiler message is coded - it means - there is no member named Listen123.  
Do "find" for "listen" with "ignore case" option to find the offender.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 5, 2021, 10:04pm UTC](https://forum.arduino.cc/t/my-library-is-not-working/407218/7 "2021-05-05T22:04:45Z")

</div>

Closed on May 5, 2021, 10:04pm UTC


