Closed alignan closed 7 years ago
I don't know what's happen on only this error line.
@hirotakaster, the common practice for all headers should be to guard against multiple inclusion. This is either done as
#ifndef _YOUR_LIBRARY_H_
#define _YOUR_LIBRARY_H_
// here follows the code
#endif
or via
#pragma once
// here follows your code
Hi @ScruffR I add ifdef to header file, but I can't use MQTT my lib on WebIDE and local Particle Dev!! compile message is "MQTT.h: No such file or directory".
#include <MQTT.h>
#include "MQTT.h"
#include "MQTT/MQTT.h"
all patter is fail "MQTT.h: No such file or directory" now. I don't know why this happen, but I think Particle community lib is broken now.
That is due to an issue on the Particle side. https://github.com/spark/particle-dev-libraries/issues/26
You need to remove the nested MQTT
folder with the header stubs (on your local copy of the lib, not on the published version).
@ScruffR Okay, thank you. I can compile on "Particle Dev" local pc. But still can't compile on WebIDE.
To avoid errors like
error: previous definition of 'class MQTT'