user3837: I'm having trouble adding attachInterrupt in a library that I am creating. I researched a lot, and I noticed that this is a common mistake, but do not quite understand the answers I found.
The error in question is this:
sketch_nov04a.ino: In function 'void setup()':
sketch_nov04a:10: error: argument of type 'void (Teste::)()' does not match 'void (*)()'

My library is as follows: 
Teste.h
#ifndef TESTE_H
#define TESTE_H
#include <Arduino.h>

class Teste
{
public:
    volatile long lastWindIRQ;
    volatile byte windClicks;

  void wspeedIRQ();
};
#endif

Teste.cpp
#include "Teste.h"

void Teste::wspeedIRQ()
{
  if (millis() - this.lastWindIRQ > 10)
  {
    this.lastWindIRQ = millis();
    this.windClicks++;
  }
}

my implementation
#include <Teste.h>

Teste teste;

void setup()
{
  Serial.begin(9600);
  pinMode(2, INPUT);
  digitalWrite(2, HIGH);
  attachInterrupt(0, teste.wspeedIRQ, FALLING);
}

void loop()
{
  Serial.println(teste.windClicks);
  delay(3000);
}

EDIT: Updated the error and corrected the problem cited by Ignacio

user42: The problem is that wspeedIRQ() is a member function (i.e. it's part of the Teste class), but attachInterrupt() expects a non-member function (i.e. a function which is static and/or not part of a class at all).
This is a very important distinction in C++ because it affects how the compiler calls the function behind-the-scenes. There is unfortunately no way to use a member function directly with attachInterrupt().
Various workarounds are possible though. The simplest is to write a wrapper function which calls the member function. For example:
Teste teste;

// This is a non-member function...
void isr()
{
    // ...which calls the member function:
    teste.wspeedIRQ();
}

void setup()
{
    //...

    // Setup interrupt to use a non-member function
    attachInterrupt(0, isr, FALLING);
}

As a side note, your implementation of wspeedIRQ() won't compile at the moment anyway. The reason is that this. is invalid. It's a pointer so the correct syntax is this->.
(In practice, you usually don't need to use this to access member data. C++ figures it out automatically, unless there's a naming conflict.)

3837: <p>I'm having trouble adding attachInterrupt in a library that I am creating. I researched a lot, and I noticed that this is a common mistake, but do not quite understand the answers I found.</p>

<p>The error in question is this:</p>

<pre><code>sketch_nov04a.ino: In function 'void setup()':
sketch_nov04a:10: error: argument of type 'void (Teste::)()' does not match 'void (*)()'
</code></pre>

<p>My library is as follows: </p>

<p><strong>Teste.h</strong></p>

<pre><code>#ifndef TESTE_H
#define TESTE_H
#include &lt;Arduino.h&gt;

class Teste
{
public:
    volatile long lastWindIRQ;
    volatile byte windClicks;

  void wspeedIRQ();
};
#endif
</code></pre>

<p><strong>Teste.cpp</strong></p>

<pre><code>#include "Teste.h"

void Teste::wspeedIRQ()
{
  if (millis() - this.lastWindIRQ &gt; 10)
  {
    this.lastWindIRQ = millis();
    this.windClicks++;
  }
}
</code></pre>

<p><strong>my implementation</strong></p>

<pre><code>#include &lt;Teste.h&gt;

Teste teste;

void setup()
{
  Serial.begin(9600);
  pinMode(2, INPUT);
  digitalWrite(2, HIGH);
  attachInterrupt(0, teste.wspeedIRQ, FALLING);
}

void loop()
{
  Serial.println(teste.windClicks);
  delay(3000);
}
</code></pre>

<p><strong>EDIT</strong>: Updated the error and corrected the problem cited by Ignacio</p>
 42: <p>The problem is that <code>wspeedIRQ()</code> is a member function (i.e. it's part of the <code>Teste</code> class), but <code>attachInterrupt()</code> expects a non-member function (i.e. a function which is static and/or not part of a class at all).</p>

<p>This is a very important distinction in C++ because it affects how the compiler calls the function behind-the-scenes. There is unfortunately no way to use a member function directly with <code>attachInterrupt()</code>.</p>

<p>Various workarounds are possible though. The simplest is to write a wrapper function which calls the member function. For example:</p>

<pre><code>Teste teste;

// This is a non-member function...
void isr()
{
    // ...which calls the member function:
    teste.wspeedIRQ();
}

void setup()
{
    //...

    // Setup interrupt to use a non-member function
    attachInterrupt(0, isr, FALLING);
}
</code></pre>

<p>As a side note, your implementation of <code>wspeedIRQ()</code> won't compile at the moment anyway. The reason is that <code>this.</code> is invalid. It's a pointer so the correct syntax is <code>this-&gt;</code>.</p>

<p>(In practice, you usually don't need to use <code>this</code> to access member data. C++ figures it out automatically, unless there's a naming conflict.)</p>
