[SOLVED] Multiple Definitions Error

Hey guys,

i have a question related to library programming.
I want to use the Webduino (WebServer.h) library in my new library.

I include a #include <WebServer.h> in my .ino file, i include a #include "WebServer.h" in my library's h file.
Wen i try to compile the code i get the following errors:

Inomation/Inomation.cpp.o: In function `WebServer::setDefaultCommand(void (*)(WebServer&, WebServer::ConnectionType, char*, bool))':
/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.h:389: multiple definition of `WebServer::setDefaultCommand(void (*)(WebServer&, WebServer::ConnectionType, char*, bool))'
Inomation.cpp.o:/Applications/Arduino.app/Contents/Resources/Java/libraries/Webduino/WebServer.h:389: first defined here

I hope you can help me to figure this out.

kind regards
max

Hi Max

I include a #include <WebServer.h> in my .ino file, i include a #include "WebServer.h" in my library's h file.

Have you tried using < > for both includes?

#include <WebServer.h>

Regards

Ray

I hope you can help me to figure this out.

Without knowing anything about the library you are developing, or the one you are trying to use in it, it really doesn't seem likely.

Post a link to the WebServer library and post ALL of your code.

Ok, sorry for that.

Yeah i tried using < > both times. I didnt work.

Here the link for the WebServer library: GitHub - sirleech/Webduino: Arduino WebServer library
Here for my library: https://dl.dropboxusercontent.com/u/17577578/Inomation.zip

You have a function in Inomation.cpp that is not in Inomation.h.

void ParsedCmd(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete)

EDIT added ...

Also, have you tried compiling one of the WebServer example programs to see if the problem is in how the library has been installed?

Thats right, but that doesnt solve the problem :confused:

And yes, i tried thewebserver examples.

Just to confirm, did you remove ParseCmd from the .cpp or add it to .h?

And the examples compile OK?

Examples are ok and yes i added the parseCmd to the .h file.

Just did a search on this website.

See this post from PaulS two years ago. Solved a similar-sounding problem.

http://forum.arduino.cc/index.php?topic=120624.msg1006859#msg1006859

I am really grateful for this answer. It solved my problem. Thank you.