You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The support for STL vector of strings is broken. Here's an example:
Works fine: function reverse_str. It takes one std string as input, and returns another std string.
Doesn't work fine: function reverse_each_str. It takes STL vector of strings as input, and returns another STL vector of strings.
swig -javascript -node -c++ -outdir example -o example/example_nodejs.cxx example.i
cd example
node-gyp --python <path_to_python2.7> --nodedir <path_to_your_node_install_dir> configure build
cd<path_to_test.js>
./test.js
I think --nodedir <path_to_your_node_install_dir> is optional, I had to add a path to point to correct node version (I tried multiple: 6.x, 8.x...). Also the --python <path_to_python2.7> is optional if you are using not using python 3 or above.
Also, I applied patch from #968 as I had node 8 installed, that got me going with node 8, and function reverse_str works, but reverse_each_str doesn't.
Thanks for this tool & help in advance. Have used SWIG with other languages, its a great tool.
Best,
Aman
The text was updated successfully, but these errors were encountered:
I have the same issue. I just tried v4.0.0 from master @ 67f5ade7ad03f15a2811190df899196dbf5a12fe. When I print the result of a function returning a vector of string in JavaScript I just get _exports_StringVector {}
Hi,
The support for STL vector of strings is broken. Here's an example:
Works fine: function reverse_str. It takes one std string as input, and returns another std string.
Doesn't work fine: function reverse_each_str. It takes STL vector of strings as input, and returns another STL vector of strings.
File example.i:
File binding.gyp:
Example test.js:
Shell commands:
I think --nodedir <path_to_your_node_install_dir> is optional, I had to add a path to point to correct node version (I tried multiple: 6.x, 8.x...). Also the --python <path_to_python2.7> is optional if you are using not using python 3 or above.
Also, I applied patch from #968 as I had node 8 installed, that got me going with node 8, and function reverse_str works, but reverse_each_str doesn't.
Thanks for this tool & help in advance. Have used SWIG with other languages, its a great tool.
Best,
Aman
The text was updated successfully, but these errors were encountered: