From: Nora on 5 Feb 2010 08:02 Dear all, I use VTK (thus c++ code) for some computationally hard parts in my matlab program. There are different scenarios that happen to me randomly: 1. Building and running the mex file succeeds as it should 2. Building without errors, but matlab crashes when running 3. I am able to build the .mexw32 files without errors, but get the following error message when I call it: ??? Invalid MEX-file 'D:\matlabCode\SourceC\myCppFunction.mexw32': The specified procedure could not be found. .. Even though "which myCppFunction" exactly finds the myCppFunction.mexw32 I don't know what I do different when I get these different scenarios. Any idea what can be wrong and how to fix this? I have Matlab 2007b, and use Visual C++ 2005. Thanks
From: Rune Allnor on 5 Feb 2010 08:13 On 5 Feb, 14:02, "Nora " <mail.bn...(a)gmail.com> wrote: > Dear all, > > I use VTK (thus c++ code) for some computationally hard parts in my matlab program. > There are different scenarios that happen to me randomly: > 1. Building and running the mex file succeeds as it should > 2. Building without errors, but matlab crashes when running > 3. I am able to build the .mexw32 files without errors, but get the following error message when I call it: > > ??? Invalid MEX-file 'D:\matlabCode\SourceC\myCppFunction.mexw32': The specified procedure could not be found. > > . > > Even though "which myCppFunction" exactly finds the myCppFunction.mexw32 > > I don't know what I do different when I get these different scenarios. Any idea what can be wrong and how to fix this? If error 3 happens intermittantly (that is, it happens and then not, even if you have done nothing to the .cpp file), this might be a hardware problem. Either an unstable disk drive, if the disk is local, or an unstable network. Item 1 and 2 are typical for rogue pointers, which is a common problem for C(++) code. Rune
From: Nora on 5 Feb 2010 09:57 Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <92c6eda5-b509-4eec-a8be-b0c80733dac0(a)u9g2000yqb.googlegroups.com>... > On 5 Feb, 14:02, "Nora " <mail.bn...(a)gmail.com> wrote: > > Dear all, > > > > I use VTK (thus c++ code) for some computationally hard parts in my matlab program. > > There are different scenarios that happen to me randomly: > > 1. Building and running the mex file succeeds as it should > > 2. Building without errors, but matlab crashes when running > > 3. I am able to build the .mexw32 files without errors, but get the following error message when I call it: > > > > ??? Invalid MEX-file 'D:\matlabCode\SourceC\myCppFunction.mexw32': The specified procedure could not be found. > > > > . > > > > Even though "which myCppFunction" exactly finds the myCppFunction.mexw32 > > > > I don't know what I do different when I get these different scenarios. Any idea what can be wrong and how to fix this? > > If error 3 happens intermittantly (that is, it happens and then > not, even if you have done nothing to the .cpp file), this might > be a hardware problem. Either an unstable disk drive, if the disk > is local, or an unstable network. > > Item 1 and 2 are typical for rogue pointers, which is a common > problem for C(++) code. > > Rune Hi, Thank you for the fast reply. I don't think it is a hardware problem, as it is on my hard drive, and no other program has problems with it. I figured out that error 3 only happens if I want to run the function immediately after compiling it, while being in the same directory as the function itself. Changing the current directory solves that problem (even if I just change it, and change it back). I don't know why, but seems to work like that. Nora
From: Rune Allnor on 5 Feb 2010 10:28 On 5 Feb, 15:57, "Nora " <mail.bn...(a)gmail.com> wrote: > Rune Allnor <all...(a)tele.ntnu.no> wrote in message <92c6eda5-b509-4eec-a8be-b0c80733d...(a)u9g2000yqb.googlegroups.com>... > > On 5 Feb, 14:02, "Nora " <mail.bn...(a)gmail.com> wrote: > > > Dear all, > > > > I use VTK (thus c++ code) for some computationally hard parts in my matlab program. > > > There are different scenarios that happen to me randomly: > > > 1. Building and running the mex file succeeds as it should > > > 2. Building without errors, but matlab crashes when running > > > 3. I am able to build the .mexw32 files without errors, but get the following error message when I call it: > > > > ??? Invalid MEX-file 'D:\matlabCode\SourceC\myCppFunction.mexw32': The specified procedure could not be found. > > > > . > > > > Even though "which myCppFunction" exactly finds the myCppFunction.mexw32 > > > > I don't know what I do different when I get these different scenarios.. Any idea what can be wrong and how to fix this? > > > If error 3 happens intermittantly (that is, it happens and then > > not, even if you have done nothing to the .cpp file), this might > > be a hardware problem. Either an unstable disk drive, if the disk > > is local, or an unstable network. > > > Item 1 and 2 are typical for rogue pointers, which is a common > > problem for C(++) code. > > > Rune > > Hi, > > Thank you for the fast reply. I don't think it is a hardware problem, as it is on my hard drive, and no other program has problems with it. > I figured out that error 3 only happens if I want to run the function immediately after compiling it, while being in the same directory as the function itself. Changing the current directory solves that problem (even if I just change it, and change it back). > I don't know why, but seems to work like that. Could you post the command you use to attempt to run the MEX file, the one that fails unless you change directory first? Rune
From: Nora on 5 Feb 2010 10:49 Rune Allnor <allnor(a)tele.ntnu.no> wrote in message <f852d8cc-faef-4347-8a43-618b7e420ff8(a)h2g2000yqj.googlegroups.com>... > On 5 Feb, 15:57, "Nora " <mail.bn...(a)gmail.com> wrote: > > Rune Allnor <all...(a)tele.ntnu.no> wrote in message <92c6eda5-b509-4eec-a8be-b0c80733d...(a)u9g2000yqb.googlegroups.com>... > > > On 5 Feb, 14:02, "Nora " <mail.bn...(a)gmail.com> wrote: > > > > Dear all, > > > > > > I use VTK (thus c++ code) for some computationally hard parts in my matlab program. > > > > There are different scenarios that happen to me randomly: > > > > 1. Building and running the mex file succeeds as it should > > > > 2. Building without errors, but matlab crashes when running > > > > 3. I am able to build the .mexw32 files without errors, but get the following error message when I call it: > > > > > > ??? Invalid MEX-file 'D:\matlabCode\SourceC\myCppFunction.mexw32': The specified procedure could not be found. > > > > > > . > > > > > > Even though "which myCppFunction" exactly finds the myCppFunction.mexw32 > > > > > > I don't know what I do different when I get these different scenarios. Any idea what can be wrong and how to fix this? > > > > > If error 3 happens intermittantly (that is, it happens and then > > > not, even if you have done nothing to the .cpp file), this might > > > be a hardware problem. Either an unstable disk drive, if the disk > > > is local, or an unstable network. > > > > > Item 1 and 2 are typical for rogue pointers, which is a common > > > problem for C(++) code. > > > > > Rune > > > > Hi, > > > > Thank you for the fast reply. I don't think it is a hardware problem, as it is on my hard drive, and no other program has problems with it. > > I figured out that error 3 only happens if I want to run the function immediately after compiling it, while being in the same directory as the function itself. Changing the current directory solves that problem (even if I just change it, and change it back). > > I don't know why, but seems to work like that. > > Could you post the command you use to attempt to run the > MEX file, the one that fails unless you change directory > first? > > Rune Hi Rune, You were right with error 2. That is successfully solved. Also error 3 doesn't bother me that much anymore, as I know how get over it. My function takes 3 input arguments, and gives 3 outputs back. So I simply call [out1,out2,out3] = myCppFunction(in1,in2,in3); Nora
|
Pages: 1 Prev: matlab 7.0 problem in WIN7 solution... Next: using different types of edges in same biograph |