Nirav Vora
2015-03-20 20:18:31 UTC
Hi,
I have created a C++ library that is exposing few public methods:
1) void getStringMessagePacket(std::string & stringMsg);
2) void getCharMessagePacket(char** charMsg);
3) std::string getRetStringMessagePacket();
I have successfully created node module from above c++ library using SWIG:
swig -lstd_string.i -c++ -javascript -v8 -DV8_VERSION=0x032873 msgLib.i
I am able to successfully get and print the string values from javascript
application for (3) method above.
Following is snapshot of javascript syntax used to invoke (1) API:
var inputData = "hello";
instanceTP.getStringMessagePacket(inputData);
However i am getting following error for (1):
Error: in method 'TPLayerClass_getStringMessagePacket', argument 2 of type
'std::string &'
at Error (native)
Here is the signature created in wrapper file :
static SwigV8ReturnValue
_wrap_transportLayerClass_getStringMessagePacket(const SwigV8Arguments
&args) {
.
.
}
I have included following in ".i" file in very beginning:
%include "std_string.i"
Any inputs/suggestions are highly appreciated.
Thanks & Regards,
NV
I have created a C++ library that is exposing few public methods:
1) void getStringMessagePacket(std::string & stringMsg);
2) void getCharMessagePacket(char** charMsg);
3) std::string getRetStringMessagePacket();
I have successfully created node module from above c++ library using SWIG:
swig -lstd_string.i -c++ -javascript -v8 -DV8_VERSION=0x032873 msgLib.i
I am able to successfully get and print the string values from javascript
application for (3) method above.
Following is snapshot of javascript syntax used to invoke (1) API:
var inputData = "hello";
instanceTP.getStringMessagePacket(inputData);
However i am getting following error for (1):
Error: in method 'TPLayerClass_getStringMessagePacket', argument 2 of type
'std::string &'
at Error (native)
Here is the signature created in wrapper file :
static SwigV8ReturnValue
_wrap_transportLayerClass_getStringMessagePacket(const SwigV8Arguments
&args) {
.
.
}
I have included following in ".i" file in very beginning:
%include "std_string.i"
Any inputs/suggestions are highly appreciated.
Thanks & Regards,
NV