Issue after compiling script containing TCPIP

3 次查看(过去 30 天)
Hi everyone, I compiled a script that contains the tcpip function from the instruments toolbox using MCR_R2015a. Running the generated executable on the PC I used for compiling (Windows7) is not a problem, however running it on another PC (Windows10, no Matlab installed) is. I receive the following error:
unknown variable com or unknown class com.mathworks.toolbox.instrument.TCPIP
pointing on line 123 in tcpip
try
obj.jobject = handle(com.mathworks.toolbox.instrument.TCPIP(host,port));
catch aException
newExc = MException('instrument:tcpip:cannotCreate',aException.message);
throw(newExc); % this is line 123
end
Obviously com.mathworks.toolbox.instrument.TCPIP is not known. I tried to find the file defining this object to append it when compiling without success.
Anyone who knows where to find that file or who knows how to compile a running executable?

采纳的回答

Matthias Will
Matthias Will 2017-5-11
After installing Matlab on the second PC (Win10), running the script in Matlab is not a problem. Then, I compiled another executable on the second PC, again using MCR_R2015a. Running the generated exe I received the same error as above.
As I was able to run the script inside Matlab but not the executable using the Matlab compiler runtime, I figured an unset path in the MCR may cause the error.
Not being able to find the file were the path to the TCPIP class is defined, I ended up deinstalling the MCR. Et voilá, it worked!
I am aware this solution is not answering the question how to compile scripts containing the tcpip function and running the generated exe on PCs that have no Matlab installed. But it is good enough for me.
  2 个评论
Walter Roberson
Walter Roberson 2017-5-11
I am not entirely clear where it was you uninstalled MCR from? Was it from the system you were doing the compiling on, but you left it installed on the system you were executing on?
Matthias Will
Matthias Will 2017-5-18
I compiled on the "target" system and unistalled MCR_R2015a on the "target" system. Matlab is still installed though.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by