Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C Shared Library (matlabrc problem)

67 views
Skip to first unread message

Hanifa

unread,
Sep 27, 2007, 5:39:27 AM9/27/07
to
Hi,
With reference to this tutorial
How do I create a C shared library with MATLAB Compiler 4.0
that can be used in a Microsoft .NET 2003 project ?
http://www.mathworks.com/support/solutions/data/1-UR7P0.html?1-UR7P0

I had followed this tutorial and was able to compile
successfully with some changes like instead of
$MATLAB\extern\include , I used the complete directory name.

However,the problems arose during runtime.
Upon hitting this line ---foolinInitialize()
A barrage of java errors(I presume) like
Warning: Could not read classpath.txt
Warning: Could not read librarypath.txt... etc..
But I clicked Ok for all these diaglog boxes.

But alas, I received this error,
??? Undefined function or variable 'matlabrc'.

After some googling, I found this site
http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/index.html?/access/helpdesk/help/toolbox/compiler/bqoy17y.html&http://www.google.com.sg/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&q=%22%3F%3F%3F+Undefined+function+or+variable+%27matlabrc%27.%22&btnG=Search&meta=
This was solution given there
[quote]
Undefined function or variable 'matlabrc'. When MATLAB or
the MCR starts, they attempt to execute the M-file
matlabrc.m. This message means that this file cannot be found.
To work around this, try each of these suggestions in this
order:
-Ensure that your application runs in MATLAB (uncompiled)
without this error.
-Ensure that MATLAB starts up without this error.
-Verify that the generated CTF archive contains a file
called matlabrc.m.
-Verify that the generated code (in the
*_mcc_component_data.c* file) adds the CTF archive directory
containing matlabrc.m to the MCR path.
-Delete the *_mcr directory and rerun the application.
-Recompile the application.
[/quote]

I have tried all the suggestions except this one.."Verify
that generated CTF...... to the MCR path" as I dont know how
check whether mcc_component adds matlabrc.m file to MCR path.

Anyone can give me any suggestion or help on how to go about
solving this..
Thanks.

Mark Jones

unread,
Sep 27, 2007, 9:17:32 AM9/27/07
to

Hi Hanifa,

For example, after you attempt to run your application you will have a
*_mcr directory. If you search that directory for matlabrc.m you should
find it under *_mcr\toolbox\local

And, if you look inside *_mcc_component_data.c, where it defines
MCC_*_matlabpath_data you should see "toolbox/local/".

However, whether you find "toolbox/local/" in the .c file or not, I
would suggest that you submit a help request at:

http://www.mathworks.com/support/

They should be able to help you troubleshoot this more thoroughly.

Mark

Hanifa

unread,
Sep 27, 2007, 10:38:20 PM9/27/07
to
Mark Jones <mark....@mathworks.com> wrote in message
<fdgahc$ona$1...@fred.mathworks.com>...

Hi Mark, thanks for the reply..
I did find matlabrc.m in the toolbox but under this directory
foolib_mcr\toolbox\compiler\deploy
Anwyway I have put up a bug at website, you have given.
Hopefully, there is a resolution to this problem.


Hanifa

unread,
Oct 4, 2007, 6:06:10 AM10/4/07
to
"Hanifa " <han...@mathworks.com> wrote in message
<fdftof$spd$1...@fred.mathworks.com>...

Hi,
does anyone know how to solve this problem... will be
happy if someome could give a hint..


??? Undefined function or variable 'matlabrc'.

Googling didnt help.. :(

Boffi23

unread,
Nov 7, 2007, 11:45:05 AM11/7/07
to
Hi

I am also interested in an answer, because I got the same problem
under Linux.

Unter Windows XP everything works fine.
I do not unterstand why...

0 new messages