Baeyens eclipse how to properly build and include my own library


Using the great eclipse plugin by Jantje ( and experience (probably some linker related) errors.

I am trying to use a custom library which I built.
Using the following code in eclipse:

#include "DuinoFishGuppy.h"
#include "Test.h"

Test * pTest;

void setup()
  pTest = new Test();


void loop()

Using the following code in the library:

#ifndef Test_H_
#define Test_H_

#include <Arduino.h>

class Test {
	void DoSomething();



#include "Test.h"


void Test::DoSomething()


Results in the following errors:
undefined reference to Test::DoSomething()' undefined reference to Test::Test()’

Console output:

../DuinoFishGuppy.h:11:18: fatal error: Test.h: No such file or directory

When I copy the library folder to the arduino libraries folder, the code works.

I have the folder in which the library is placed linked in the private libraries folder configuration in the arduino plugin config.

What am I doing wrong?!
Did I forget something?

The easiest way to make a library using the plugin is as follows
Just keep the code in your project folder untill it has matured.
Create a folder in your private libraries folder with the name of your library
Import the library you just created.
Drag and drop the code to the imported library.

Best regards

Hello Jantje,

Thanks for your fast response!

That does not seem like an option. Or I have misunderstood something.

The problem is as follows:
The project which I am working on will be uploaded to, at this point, 2 arduino boards.
Both boards will be configurable by a configuration header file.

If I start developing now, using the way you described, this means that if I would need to change some part of the code (which will consist of about 15+ CPP & H files), I would need to change it in both projects in eclipse.

Is there really no other way, like that they share the library like arduino IDE does?

What I explained should result in a standard arduino library. Try it out it is not that much work. Off course you can skip the maturing part for the test :wink:


That indeed works like a charm!
If I edit a file in project 1, project 2 immediately shows the latest additions without any further actions needed.

That was exactly what I was looking for and it works exactly like arduino does!

Thanks again for your help and thanks for your plugin!


One last question:
When I want to use ethernet I cannot get it fully working.

I have included the Ethernet and SPI libraries of arduino.

Somehow it complains about pins_arduino.h;
SPI.cpp:11:26: fatal error: pins_arduino.h: No such file or directory

How to fix?

which version of the plugin are you using?
How have you created the project?
Mostly this happens because the project has not been created the easy way. The easy way is different between V1 and V2.

Best regards

Hello Jantje,

I created the project using new->project->arduino project.
The library was created using the import function and selecting private library.
I have created private library source and header files using eclipse.

Since my library had to use ethernet, I imported ethernet and spi arduino libraries to the project as well.

Plugin version:

Full error message:

-I"/media/LData/Programs/arduino-1.0.5/libraries/SPI" -D__IN_ECLIPSE__=1 -DARDUINO=105 -DUSB_PID= -DUSB_VID= -Wall -Os -ffunction-sections -fdata-sections -fno-exceptions -g -mmcu=atmega328p -DF_CPU=16000000UL -MMD -MP -MF"SPI/SPI.d" -MT"SPI/SPI.d"  -c -o "SPI/SPI.o" -x c++ "/media/LData/Programs/arduino-1.0.5/libraries/SPI/SPI.cpp"
/media/LData/Programs/arduino-1.0.5/libraries/SPI/SPI.cpp:11:26: fatal error: pins_arduino.h: No such file or directory
compilation terminated.
make: *** [SPI/SPI.o] Error 1

Is that sufficient?

Robert Jacobs

can you share the header file and the top of your sketch?
Best regards

In between posting I have created a new project, imported the same libraries in the same way (as tried before) and it seems to be working now.
No idea what was wrong, but I am glad it is working now.

In the meantime I was switching between eclipse and arduino IDE to compile and run the code. :relaxed:

Thanks again for your help!

good to hear it works :slight_smile: