Issue after compiling script containing TCPIP

3 Ansichten (letzte 30 Tage)
Matthias Will
Matthias Will am 5 Mai 2017
Kommentiert: Matthias Will am 18 Mai 2017
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?

Akzeptierte Antwort

Matthias Will
Matthias Will am 11 Mai 2017
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 Kommentare
Walter Roberson
Walter Roberson am 11 Mai 2017
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 am 18 Mai 2017
I compiled on the "target" system and unistalled MCR_R2015a on the "target" system. Matlab is still installed though.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by