Matlab error Unknown error after compiling a script containing TCPIP protocol
I have compiled a script that uses a function tcpip
from the toolbox using MCR_R2015a. Running the generated executable on the PC that I used to compile (Windows7) is not a problem, however running it on another PC (Windows10, without Matlab installed). I am getting the following error:
unknown variable com or unknown class com.mathworks.toolbox.instrument.TCPIP
pointing to line 123 in tcpip
. Surrounding code:
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
unknown. I tried to find the file defining this object to add it on compilation with no success.
Where can I find this file or how do I compile the executable file?
source to share
Since I was able to run the script inside Matlab, but not the executable using the Matlab compiler runtime, I realized that the canceled path in MCR might cause an error.
Couldn't find file, TCPIP classpath was defined, I finished uninstalling MCR. Et voilรก, it worked!
I know this solution does not answer the question of how to compile scripts containing a function tcpip
and run the generated exe on PCs that do not have Matlab. But that's good enough for me.
source to share