robotology / yarp-matlab-bindings

SWIG-based bindings of YARP for Matlab and Octave, based on the MEX C-API.
6 stars 5 forks source link

Errors while compiling with YARP_USES_MATLAB=ON if YARP is compiled with YARP_WRAP_STL_STRING set to OFF #15

Closed gabrielenava closed 7 years ago

gabrielenava commented 7 years ago

I tried to compile the devel branch of this repo. I got the following error:

gnava@iitiicubws039:~/Software/gitHub/robotology/codyco-superbuild/build/libraries/yarp-matlab-bindings (master)$ make
[ 50%] Building CXX object matlab/CMakeFiles/yarpMEX.dir/autogenerated/yarpMATLAB_wrap.cxx.o
/home/gnava/Software/gitHub/robotology/codyco-superbuild/libraries/yarp-matlab-bindings/matlab/autogenerated/yarpMATLAB_wrap.cxx: In function ‘int _wrap_plus__SWIG_0(int, mxArray**, int, mxArray**)’:
/home/gnava/Software/gitHub/robotology/codyco-superbuild/libraries/yarp-matlab-bindings/matlab/autogenerated/yarpMATLAB_wrap.cxx:4954:12: error: ‘operator+’ is not a member of ‘yarp::os’
   result = yarp::os::operator +((yarp::os::ConstString const &)*arg1,(yarp::os:
gabrielenava commented 7 years ago

similar to https://github.com/robotology-playground/yarp-matlab-bindings/issues/14

traversaro commented 7 years ago

Unable to reproduce on my machine, are you using the branch devel of both YARP and yarp-matlab-bindings ?

gabrielenava commented 7 years ago

Yes I'm in devel in both repos. I have everything installed using codyco-superbuild.

traversaro commented 7 years ago

Quick fix: set the YARP cmake configuration variable YARP_WRAP_STL_STRING to ON. The default for this variable has been changed in https://github.com/robotology/yarp/pull/1406 .

traversaro commented 7 years ago

I could push the bindings that work with YARP_WRAP_STL_STRING to OFF, but this would break the compilation for all the users that still have YARP_WRAP_STL_STRING set to ON in their cache. : (

gabrielenava commented 7 years ago

It is compiling, so this workaround fixed the issue for now.

traversaro commented 7 years ago

@drdanz This is a bit of an edge case, and probably is not worth changing the decision taken for YARP https://github.com/robotology/yarp/pull/1406#issuecomment-336433473 , but the fact that *nix and Windows use different default settings for YARP_WRAP_STL_STRING make distributing the generated bindings for matlab extremly cumbersome.

traversaro commented 7 years ago

Pushed two new commits on the devel branch:

This means that from now on if you are using the devel branch, you will need to have the YARP_WRAP_STL_STRING of YARP set to OFF (the default for new YARP builds on *nix, but on old build and on Windows it is necessary to specify it explicitly).

traversaro commented 7 years ago

Solved by the commits mentioned in https://github.com/robotology-playground/yarp-matlab-bindings/issues/15#issuecomment-339272544 , see https://github.com/robotology-playground/yarp-matlab-bindings/issues/17 for more info.

diegoferigo commented 7 years ago

Tested, I confirm it works flawlessly now.