Why can't I compile tcpclient in MATLAB R2018a?

2 views (last 30 days)
I have a very simple code that works fine in MATLAB R2018a but not in a compiled application.
t = tcpclient('www.mathworks.com', 80)
It seems like function 'tcpclient' cannot be compiled using MATLAB Compiler R2018a.
When run the executable after compiling, the following error is thrown-
"The specified superclass 'matlabshared.transportlib.internal.ITransport' contains a parse error, cannot be found on MATLAB's search path, or is shadowed by another file with the same name.
MATLAB:networklib:tcpclient:cannotCreateObject "
The same code works fine in until R2017b in both MATLAB and compiled environments.
How can I make it work in R2018a?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 2 Apr 2018
There is a problem in R2018a MATLAB Compiler as it does not detect the files required to compile 'tcpclient'.
This will be fixed in future releases.
A workaround for this issue would be to add transportlib folder in mcc command manually by -a flag.
Assuming the file name is test1.m and you have installed MATLAB on default location, the command you may need to run is-
>> mcc -m test1.m -a 'C:\Program Files\MATLAB\R2018a\toolbox\shared\transportlib'
If you are compiling this using deploytool UI, please add the following statement to the additional parameters passed to MCC under settings in deploytool UI-
-a 'C:\Program Files\MATLAB\R2018a\toolbox\shared\transportlib'

More Answers (0)

Categories

Find more on Application Deployment in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!