When I try and run the example application (from visual
studio 2005) I get the error message.
Could not initialize the library. Exception: Unable to find
an entry point named 'libtimestwoInitialize' in DLL
'C:\Documents and Settings\Drew\My
Documents\MATLAB\libtimestwo.dll'.
Press Enter to Finish
I'm not really sure what this means, but it may be something
to do with the compiler I'm using, the only options I get
when I run mbuild setup are:
>> mbuild -setup
Please choose your compiler for building standalone MATLAB
applications:
Would you like mbuild to locate installed compilers [y]/n? y
Select a compiler:
[1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2007a\sys\lcc
[2] Microsoft Visual C++ 2005 in C:\Program Files\Microsoft
Visual Studio 8
[3] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft
Visual Studio
[0] None
I don't think (correct me if I'm wrong) that any of these
are the correct complier. Bearing in mind that this is a C#
application what compiler should I be using and how do I
get/install it?
Subject: Re: How do I use the matlab compiler correctly?
Any of those compilers will work. Make sure you've followed
the steps EXACTLY, including capitalization of names. It is
important that you are generating a C shared lib, not C++.
If you generate C++, you'll get name mangling which will
cause the error you are seeing.
Open the VS.NET 2005 command prompt. change to the dir
wherein the DLL lives. run "dumpbin/exports
libtimestwo.dll" to see the exported entry points in that
DLL. you should see 'libtimestwoInitialize' (or
'_libtimestwoInitialize', I forget). if you don't see that,
then your DLL isn't built right. Tell me what you do see.
reilly.
"Drew McLaughlin" <dsmclaughlin@gmail.com> wrote in message
<frr9i3$e9q$1@fred.mathworks.com>...
> Hi,
>
> I'm trying to follow this guide
> http://www.mathworks.com/support/solutions/data/1-X1PFC.html
> to generate a DLL so that I can access it from a C#
> application I have written.
>
> When I try and run the example application (from visual
> studio 2005) I get the error message.
>
> Could not initialize the library. Exception: Unable to find
> an entry point named 'libtimestwoInitialize' in DLL
> 'C:\Documents and Settings\Drew\My
> Documents\MATLAB\libtimestwo.dll'.
> Press Enter to Finish
>
> I'm not really sure what this means, but it may be something
> to do with the compiler I'm using, the only options I get
> when I run mbuild setup are:
>
> >> mbuild -setup
> Please choose your compiler for building standalone MATLAB
> applications:
>
> Would you like mbuild to locate installed compilers [y]/n? y
>
> Select a compiler:
> [1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2007a\sys\lcc
> [2] Microsoft Visual C++ 2005 in C:\Program Files\Microsoft
> Visual Studio 8
> [3] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft
> Visual Studio
>
> [0] None
>
> I don't think (correct me if I'm wrong) that any of these
> are the correct complier. Bearing in mind that this is a C#
> application what compiler should I be using and how do I
> get/install it?
>
Subject: Re: How do I use the matlab compiler correctly?
I think this is the information you were asking for. it is
information I get after typing the command dumpbin/exports
libtimestwo.dll. The dll that produced this information was
produced using complier 1 as you said to avoid the c++
compilers.
C:\Documents and Settings\Drew\My
Documents\MATLAB>dumpbin/exports libtimestwo.dll
Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file libtimestwo.dll
File Type: DLL
Section contains the following exports for libtimestwo.dll
00000000 characteristics
47E28A4D time date stamp Thu Mar 20 16:01:17 2008
0.00 version
1 ordinal base
5 number of functions
5 number of names
I hope that helps? Also could you please tell me at what
stage I need to follow the steps exactly? When I type the
commands to compile the DLL I just copied and pasted from
the article in question.
Again many thanks for your time!
Drew
"John Reilly" <jrhokie1.nospam@yahoo.com> wrote in message
<frrchl$4qi$1@fred.mathworks.com>...
> Any of those compilers will work. Make sure you've followed
> the steps EXACTLY, including capitalization of names. It is
> important that you are generating a C shared lib, not C++.
> If you generate C++, you'll get name mangling which will
> cause the error you are seeing.
>
> Open the VS.NET 2005 command prompt. change to the dir
> wherein the DLL lives. run "dumpbin/exports
> libtimestwo.dll" to see the exported entry points in that
> DLL. you should see 'libtimestwoInitialize' (or
> '_libtimestwoInitialize', I forget). if you don't see that,
> then your DLL isn't built right. Tell me what you do see.
>
> reilly.
>
>
> "Drew McLaughlin" <dsmclaughlin@gmail.com> wrote in message
> <frr9i3$e9q$1@fred.mathworks.com>...
> > Hi,
> >
> > I'm trying to follow this guide
> > http://www.mathworks.com/support/solutions/data/1-X1PFC.html
> > to generate a DLL so that I can access it from a C#
> > application I have written.
> >
> > When I try and run the example application (from visual
> > studio 2005) I get the error message.
> >
> > Could not initialize the library. Exception: Unable to find
> > an entry point named 'libtimestwoInitialize' in DLL
> > 'C:\Documents and Settings\Drew\My
> > Documents\MATLAB\libtimestwo.dll'.
> > Press Enter to Finish
> >
> > I'm not really sure what this means, but it may be something
> > to do with the compiler I'm using, the only options I get
> > when I run mbuild setup are:
> >
> > >> mbuild -setup
> > Please choose your compiler for building standalone MATLAB
> > applications:
> >
> > Would you like mbuild to locate installed compilers [y]/n? y
> >
> > Select a compiler:
> > [1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2007a\sys\lcc
> > [2] Microsoft Visual C++ 2005 in C:\Program Files\Microsoft
> > Visual Studio 8
> > [3] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft
> > Visual Studio
> >
> > [0] None
> >
> > I don't think (correct me if I'm wrong) that any of these
> > are the correct complier. Bearing in mind that this is a C#
> > application what compiler should I be using and how do I
> > get/install it?
> >
>
Subject: Re: How do I use the matlab compiler correctly?
I think this is the information you were asking for. it is
information I get after typing the command dumpbin/exports
libtimestwo.dll. The dll that produced this information was
produced using complier 1 as you said to avoid the c++
compilers.
C:\Documents and Settings\Drew\My
Documents\MATLAB>dumpbin/exports libtimestwo.dll
Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file libtimestwo.dll
File Type: DLL
Section contains the following exports for libtimestwo.dll
00000000 characteristics
47E28A4D time date stamp Thu Mar 20 16:01:17 2008
0.00 version
1 ordinal base
5 number of functions
5 number of names
I hope that helps? Also could you please tell me at what
stage I need to follow the steps exactly? When I type the
commands to compile the DLL I just copied and pasted from
the article in question.
Again many thanks for your time!
Drew
"John Reilly" <jrhokie1.nospam@yahoo.com> wrote in message
<frrchl$4qi$1@fred.mathworks.com>...
> Any of those compilers will work. Make sure you've followed
> the steps EXACTLY, including capitalization of names. It is
> important that you are generating a C shared lib, not C++.
> If you generate C++, you'll get name mangling which will
> cause the error you are seeing.
>
> Open the VS.NET 2005 command prompt. change to the dir
> wherein the DLL lives. run "dumpbin/exports
> libtimestwo.dll" to see the exported entry points in that
> DLL. you should see 'libtimestwoInitialize' (or
> '_libtimestwoInitialize', I forget). if you don't see that,
> then your DLL isn't built right. Tell me what you do see.
>
> reilly.
>
>
> "Drew McLaughlin" <dsmclaughlin@gmail.com> wrote in message
> <frr9i3$e9q$1@fred.mathworks.com>...
> > Hi,
> >
> > I'm trying to follow this guide
> > http://www.mathworks.com/support/solutions/data/1-X1PFC.html
> > to generate a DLL so that I can access it from a C#
> > application I have written.
> >
> > When I try and run the example application (from visual
> > studio 2005) I get the error message.
> >
> > Could not initialize the library. Exception: Unable to find
> > an entry point named 'libtimestwoInitialize' in DLL
> > 'C:\Documents and Settings\Drew\My
> > Documents\MATLAB\libtimestwo.dll'.
> > Press Enter to Finish
> >
> > I'm not really sure what this means, but it may be something
> > to do with the compiler I'm using, the only options I get
> > when I run mbuild setup are:
> >
> > >> mbuild -setup
> > Please choose your compiler for building standalone MATLAB
> > applications:
> >
> > Would you like mbuild to locate installed compilers [y]/n? y
> >
> > Select a compiler:
> > [1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2007a\sys\lcc
> > [2] Microsoft Visual C++ 2005 in C:\Program Files\Microsoft
> > Visual Studio 8
> > [3] Microsoft Visual C++ 6.0 in C:\Program Files\Microsoft
> > Visual Studio
> >
> > [0] None
> >
> > I don't think (correct me if I'm wrong) that any of these
> > are the correct complier. Bearing in mind that this is a C#
> > application what compiler should I be using and how do I
> > get/install it?
> >
>
Subject: Re: How do I use the matlab compiler correctly?
That looks good. So I think the DLL was created correctly.
In my mind, I seem to remember that the .NET P/Invoke engine
will return you that very error if it tries load a DLL that
itself has some dependencies the OS can't resolve. So, make
sure that the environment, when you are running the .NET
app, has its path set up to refer to the directory
containing the MATLAB runtime. That is, the same directory
containing mclmcrrt75.dll.
Also, did you make sure to call mclInitializeApplication()
before you called your times-two init?
if that doesn't work, you could zip up your source and email
it to me.
reilly.
Subject: Re: How do I use the matlab compiler correctly?
It's comforting to know that I am at least on the right
track. However I do have a few more questions.
1) How do I change the path of my environment?
2) I searched my HDD for mclmcrrt75.ddl and could not find
it, it turns out that I have mclmcrrt76.dll (as does the
example) does this make a difference?
3) The source code I'm using is nearly identical to the
example code given here:
except that I fully qualify the directory for the location
of libtimestwo.dll i.e.
[DllImport(@"C:\Documents and Settings\Drew\My
Documents\MATLAB\libtimestwo.dll")]
(although I have a feeling this is a nasty hack which I
should try and fix if I want to deploy my final solution to
another machine)unfortunately this doesnt solve my problem
with my error (Unable to find an entry point named
'libtimestwoInitialize')
Cheers again.
Drew
"John Reilly" <jrhokie1.nospam@yahoo.com> wrote in message
<frudkj$jp$1@fred.mathworks.com>...
> Hi Drew,
>
> That looks good. So I think the DLL was created correctly.
>
> In my mind, I seem to remember that the .NET P/Invoke engine
> will return you that very error if it tries load a DLL that
> itself has some dependencies the OS can't resolve. So, make
> sure that the environment, when you are running the .NET
> app, has its path set up to refer to the directory
> containing the MATLAB runtime. That is, the same directory
> containing mclmcrrt75.dll.
>
> Also, did you make sure to call mclInitializeApplication()
> before you called your times-two init?
>
> if that doesn't work, you could zip up your source and email
> it to me.
>
> reilly.
>
>
Subject: Re: How do I use the matlab compiler correctly?
2) well, version doesn't really matter. all the matters is
the directory.
3) source code doesn't matter if it is a path problem.
1) where do i start? does your path contain the directory
where you found mclmcrrt76.dll? do you know how to check
your path? try the following:
a) open a "visual studio 2005" command prompt
b) execute the "path" command. look at the results. is the
directory where you found the MCR runtime in the path?
c) if not, execute "path=xxx;%path%", replacing "xxx" with
the MCR runtime path.
d) cd to the directory containing your .NET exe.
e) run it. does it work?
"Drew McLaughlin" <dsmclaughlin@gmail.com> wrote in message
<fs3lm1$ge0$1@fred.mathworks.com>...
> Hi Again,
>
> It's comforting to know that I am at least on the right
> track. However I do have a few more questions.
>
> 1) How do I change the path of my environment?
>
> 2) I searched my HDD for mclmcrrt75.ddl and could not find
> it, it turns out that I have mclmcrrt76.dll (as does the
> example) does this make a difference?
>
> 3) The source code I'm using is nearly identical to the
> example code given here:
>
> http://www.mathworks.com/support/solutions/data/1-X1PFC.html
>
> except that I fully qualify the directory for the location
> of libtimestwo.dll i.e.
>
> [DllImport(@"C:\Documents and Settings\Drew\My
> Documents\MATLAB\libtimestwo.dll")]
>
> (although I have a feeling this is a nasty hack which I
> should try and fix if I want to deploy my final solution to
> another machine)unfortunately this doesnt solve my problem
> with my error (Unable to find an entry point named
> 'libtimestwoInitialize')
>
> Cheers again.
>
> Drew
>
> "John Reilly" <jrhokie1.nospam@yahoo.com> wrote in message
> <frudkj$jp$1@fred.mathworks.com>...
> > Hi Drew,
> >
> > That looks good. So I think the DLL was created correctly.
> >
> > In my mind, I seem to remember that the .NET P/Invoke engine
> > will return you that very error if it tries load a DLL that
> > itself has some dependencies the OS can't resolve. So, make
> > sure that the environment, when you are running the .NET
> > app, has its path set up to refer to the directory
> > containing the MATLAB runtime. That is, the same directory
> > containing mclmcrrt75.dll.
> >
> > Also, did you make sure to call mclInitializeApplication()
> > before you called your times-two init?
> >
> > if that doesn't work, you could zip up your source and email
> > it to me.
> >
> > reilly.
> >
> >
>
Subject: Re: How do I use the matlab compiler correctly?
I have the exactly same problem. I tried all your solution
but I still get the error msg. I have mclmcrrt74.dll. is it
the problem?
Thanks
-Kurt
"John Reilly" <jrhokie1.nospam@yahoo.com> wrote in message
<fs8bcl$el7$1@fred.mathworks.com>...
> 2) well, version doesn't really matter. all the matters is
> the directory.
>
> 3) source code doesn't matter if it is a path problem.
>
> 1) where do i start? does your path contain the directory
> where you found mclmcrrt76.dll? do you know how to check
> your path? try the following:
>
> a) open a "visual studio 2005" command prompt
> b) execute the "path" command. look at the results. is the
> directory where you found the MCR runtime in the path?
> c) if not, execute "path=xxx;%path%", replacing "xxx" with
> the MCR runtime path.
> d) cd to the directory containing your .NET exe.
> e) run it. does it work?
>
>
>
> "Drew McLaughlin" <dsmclaughlin@gmail.com> wrote in message
> <fs3lm1$ge0$1@fred.mathworks.com>...
> > Hi Again,
> >
> > It's comforting to know that I am at least on the right
> > track. However I do have a few more questions.
> >
> > 1) How do I change the path of my environment?
> >
> > 2) I searched my HDD for mclmcrrt75.ddl and could not find
> > it, it turns out that I have mclmcrrt76.dll (as does the
> > example) does this make a difference?
> >
> > 3) The source code I'm using is nearly identical to the
> > example code given here:
> >
> > http://www.mathworks.com/support/solutions/data/1-X1PFC.html
> >
> > except that I fully qualify the directory for the location
> > of libtimestwo.dll i.e.
> >
> > [DllImport(@"C:\Documents and Settings\Drew\My
> > Documents\MATLAB\libtimestwo.dll")]
> >
> > (although I have a feeling this is a nasty hack which I
> > should try and fix if I want to deploy my final solution to
> > another machine)unfortunately this doesnt solve my problem
> > with my error (Unable to find an entry point named
> > 'libtimestwoInitialize')
> >
> > Cheers again.
> >
> > Drew
> >
> > "John Reilly" <jrhokie1.nospam@yahoo.com> wrote in message
> > <frudkj$jp$1@fred.mathworks.com>...
> > > Hi Drew,
> > >
> > > That looks good. So I think the DLL was created
correctly.
> > >
> > > In my mind, I seem to remember that the .NET P/Invoke
engine
> > > will return you that very error if it tries load a DLL
that
> > > itself has some dependencies the OS can't resolve.
So, make
> > > sure that the environment, when you are running the .NET
> > > app, has its path set up to refer to the directory
> > > containing the MATLAB runtime. That is, the same
directory
> > > containing mclmcrrt75.dll.
> > >
> > > Also, did you make sure to call mclInitializeApplication()
> > > before you called your times-two init?
> > >
> > > if that doesn't work, you could zip up your source and
email
> > > it to me.
> > >
> > > reilly.
> > >
> > >
> >
>
Subject: Re: How do I use the matlab compiler correctly?
So I renamed libtimestwoInitialize, libtimestwoTerminate and
mlfTimestwo into _libtimestwoInitialize, _libtimestwoTerminate and
_mlfTimestwo respectively in the C# project. This solved the problem.
Although I am sure there is a way to make matlab generate the correct
exports for C#.
Ozgur
On Jul 15, 4:32=A0am, "Kurt Zhao" <kurtz...@yeah.net> wrote:
> Hi John,
>
> I have the exactly same problem. I tried all your solution
> but I still get the error msg. I have mclmcrrt74.dll. is it
> the problem?
>
> Thanks
>
> -Kurt
>
> "John Reilly" <jrhokie1.nos...@yahoo.com> wrote in message
>
> <fs8bcl$el...@fred.mathworks.com>...
>
> > 2) well, version doesn't really matter. =A0all the matters is
> > the directory.
>
> > 3) source code doesn't matter if it is a path problem.
>
> > 1) where do i start? =A0does your path contain the directory
> > where you found mclmcrrt76.dll? =A0do you know how to check
> > your path? =A0try the following:
>
> > a) open a "visual studio 2005" command prompt
> > b) execute the "path" command. =A0look at the results. =A0is the
> > directory where you found the MCR runtime in the path?
> > c) if not, execute "path=3Dxxx;%path%", replacing "xxx" with
> > the MCR runtime path.
> > d) cd to the directory containing your .NET exe.
> > e) run it. =A0does it work?
>
> > "Drew McLaughlin" <dsmclaugh...@gmail.com> wrote in message
> > <fs3lm1$ge...@fred.mathworks.com>...
> > > Hi Again,
>
> > > It's comforting to know that I am at least on the right
> > > track. However I do have a few more questions.
>
> > > 1) How do I change the path of my environment?
>
> > > 2) I searched my HDD for mclmcrrt75.ddl and could not find
> > > it, it turns out that I have mclmcrrt76.dll (as does the
> > > example) does this make a difference?
>
> > > 3) The source code I'm using is nearly identical to the
> > > example code given here:
>
> > >http://www.mathworks.com/support/solutions/data/1-X1PFC.html
>
> > > except that I fully qualify the directory for the location
> > > of libtimestwo.dll i.e.
>
> > > [DllImport(@"C:\Documents and Settings\Drew\My
> > > Documents\MATLAB\libtimestwo.dll")]
>
> > > (although I have a feeling this is a nasty hack which I
> > > should try and fix if I want to deploy my final solution to
> > > another machine)unfortunately this doesnt solve my problem
> > > with my error (Unable to find an entry point named
> > > 'libtimestwoInitialize')
>
> > > Cheers again.
>
> > > Drew
>
> > > "John Reilly" <jrhokie1.nos...@yahoo.com> wrote in message
> > > <frudkj$j...@fred.mathworks.com>...
> > > > Hi Drew,
>
> > > > That looks good. =A0So I think the DLL was created
> correctly.
>
> > > > In my mind, I seem to remember that the .NET P/Invoke
> engine
> > > > will return you that very error if it tries load a DLL
> that
> > > > itself has some dependencies the OS can't resolve.
> So, make
> > > > sure that the environment, when you are running the .NET
> > > > app, has its path set up to refer to the directory
> > > > containing the MATLAB runtime. =A0That is, the same
> directory
> > > > containing mclmcrrt75.dll.
>
> > > > Also, did you make sure to call mclInitializeApplication()
> > > > before you called your times-two init?
>
> > > > if that doesn't work, you could zip up your source and
> email
> > > > it to me.
>
> > > > reilly.
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.