Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] C++ calling convention

Hi Herry,

yes, you can call the C API from C++ programs.   As this is a C interface, personally I would add the extern statement in the C++ program, like so:

extern "C" {
#include "MQTTAsync.h"
}

which keeps the C and C++ code separate.  However I realize that my logic does not appeal to everyone.   In any case, a C++ interface layer is being contributed, thanks to Frank Pagliughi, and is being tracked in bug #409174.  You may want to take a look at that.

Ian Craggs

On 08/05/2013 02:52 AM, Herry Sitepu wrote:
Dear all,

I think MQTTAsync could be called from C++ apps. Attached is my patch for following C++ calling convention

Regards,
Herry Sitepu


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev


Back to the top