.h files

In my project I have a class (.h and .cpp)

I added the both into my sketch project folder and referred from the sketch.

But Arduino IDE (Official)

error: TestFunc.h: No such file or directory

#include "TestFunc.h"

int led = 13;

TestFunc t;

What could be missing

There is a difference between:

#include "TestFunc.h"

and

#include <TestFunc.h>

in where the IDE looks for the files. Does changing the "s to < and > make any difference?

I changed it to

#include <TestFunc.h>

then I get

BlinkMineTest:15: error: ‘TestFunc’ does not name a type

:drooling_face:

What’s the exact name of .h file ? And capitalization of class ?

Try also testfunc.h

TestFunc.cpp

#include “TestFunc.h”
#include <Arduino.h>

TestFunc::TestFunc()
{
//ctor
}

TestFunc::~TestFunc()
{
//dtor
}

void TestFunc::blinkMine(){

Serial.println(“hello”);
}

TestFunc.h

#ifndef TESTFUNC_H
#define TESTFUNC_H

class TestFunc
{
public:
TestFunc();
virtual ~TestFunc();
void blinkMine();
protected:
private:
};

#endif // TESTFUNC_H

This worked when I restart the IDE.