Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] Unrecognized function or variable 'orcreate' in MATLAB examples #1065

Open
jaztiria99 opened this issue Mar 9, 2022 · 0 comments
Open

Comments

@jaztiria99
Copy link

jaztiria99 commented Mar 9, 2022

Hi all,

I'm trying to test OpenRAVE with MATLAB, as I've seen that MATLAB can be used in the scripting layer. I've cloned this repo and located together with the rest of MATLAB toolboxes in the following path: C:\Program Files\MATLAB\R2021b\toolbox\openrave.

I'm using MATLAB R2021b in Windows 10 and defining the previous path in "Set Path -> Add with Subfolders" in MATLAB.

For instance, I've tried to run the script "testplotting.m" inside the next folder:
https://github.com/rdiankov/openrave/tree/master/octave_matlab/examples

I'm obtaining the following error:

Unrecognized function or variable 'orcreate'.

Error in orCommunicator (line 71)
        [ip, port, sockid] = orcreate();

Error in orEnvClose (line 10)
    orCommunicator('close');

Error in testplotting (line 5)
orEnvClose(); % close all plots

I've seen that "orcreate.cpp" is a C++ file in ...\openrave\octave_matlab, so I don't know if there's some incompatibility there. In fact, I've read the following in http://openrave.programmingvision.com/wiki/index.php/OctaveMATLAB:
"In order to use MATLAB, will need to compile each of the cpp files into mex files and add that directory to your MATLAB path. The files are: - orcreate.cpp - orread.cpp - orwrite.cpp"

So, I've tried to compile that C++ scripts in MATLAB following a MathWorks guide: https://es.mathworks.com/help/matlab/matlab_external/build-c-mex-programs.html. Here is a copy of the Command Window, after making a copy of "openrave" repo in the F: disk (permission problems in C:) and setting the path F:...\octave_matlab in MATLAB.

>> mex -setup C++
MEX configured to use 'Microsoft Visual C++ 2019' for C++ language compilation.

To choose a different C++ compiler, select one from the following:
Microsoft Visual C++ 2017  mex -setup:'C:\Program Files\MATLAB\R2021b\bin\win64\mexopts\msvcpp2017.xml' C++
Microsoft Visual C++ 2019  mex -setup:'C:\Program Files\MATLAB\R2021b\bin\win64\mexopts\msvcpp2019.xml' C++

>> mex orcreate.cpp
Building with 'Microsoft Visual C++ 2019'.
Error using mex
   Creando biblioteca orcreate.lib y objeto orcreate.exp
orcreate.obj : error LNK2019: s¡mbolo externo __imp_closesocket sin resolver al que se hace referencia en la funci¢n "public: __cdecl HostConnection::~HostConnection(void)" (??1HostConnection@@QEAA@XZ)
orcreate.obj : error LNK2019: s¡mbolo externo __imp_connect sin resolver al que se hace referencia en la funci¢n "public: int __cdecl HostConnection::ConnectToHost(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,int)" (?ConnectToHost@HostConnection@@QEAAHAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)
orcreate.obj : error LNK2019: s¡mbolo externo __imp_ioctlsocket sin resolver al que se hace referencia en la funci¢n mexFunction
orcreate.obj : error LNK2019: s¡mbolo externo __imp_getsockname sin resolver al que se hace referencia en la funci¢n mexFunction
orcreate.obj : error LNK2019: s¡mbolo externo __imp_htons sin resolver al que se hace referencia en la funci¢n "public: int __cdecl HostConnection::ConnectToHost(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,int)" (?ConnectToHost@HostConnection@@QEAAHAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)
orcreate.obj : error LNK2019: s¡mbolo externo __imp_ntohl sin resolver al que se hace referencia en la funci¢n mexFunction
orcreate.obj : error LNK2019: s¡mbolo externo __imp_ntohs sin resolver al que se hace referencia en la funci¢n mexFunction
orcreate.obj : error LNK2019: s¡mbolo externo __imp_recv sin resolver al que se hace referencia en la funci¢n mexFunction
orcreate.obj : error LNK2019: s¡mbolo externo __imp_socket sin resolver al que se hace referencia en la funci¢n "public: int __cdecl HostConnection::ConnectToHost(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,int)" (?ConnectToHost@HostConnection@@QEAAHAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)
orcreate.obj : error LNK2019: s¡mbolo externo __imp_gethostbyname sin resolver al que se hace referencia en la funci¢n "public: int __cdecl HostConnection::ConnectToHost(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,int)" (?ConnectToHost@HostConnection@@QEAAHAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)
orcreate.obj : error LNK2019: s¡mbolo externo __imp_WSAStartup sin resolver al que se hace referencia en la funci¢n "public: int __cdecl HostConnection::ConnectToHost(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &,int)" (?ConnectToHost@HostConnection@@QEAAHAEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@H@Z)
orcreate.obj : error LNK2019: s¡mbolo externo __imp_WSACleanup sin resolver al que se hace referencia en la funci¢n "public: __cdecl HostConnection::~HostConnection(void)" (??1HostConnection@@QEAA@XZ)
orcreate.obj : error LNK2019: s¡mbolo externo __imp_WSAGetLastError sin resolver al que se hace referencia en la funci¢n mexFunction
orcreate.mexw64 : fatal error LNK1120: 13 externos sin resolver

Does anyone know how to solve it?

Thank you,

Jon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant