Mex-file error on 64bit

Dear All,

I get the following error message on a 64bit Windows 7 machine with Matlab 2010a and Dynare 4.1.3.
I have a code that launches several times Dynare and while everything works fine for the first 10-20 times this message occurs at some point.

Has anyone experienced the same problem?

Thanks a lot in advance,

Tarik

??? Error using ==> feval
Invalid MEX-file ‘C:\Users…\8-optimizer\constant_portfoliosV01_dynamic.mexw64’:
C:\Users…\8-optimizer\constant_portfoliosV01_dynamic.mexw64 is not a valid Win32
application.

.

Error in ==> dr1 at 153
[junk,jacobia_] = feval([M_.fname 'dynamic’],z,[oo.exo_simul …

Error in ==> resol at 128
[dr,info,M_,options_,oo_] = dr1(dr,check_flag,M_,options_,oo_);

Error in ==> check at 45
[dr, info] = resol(oo_.steady_state,1);

Error in ==> constant_portfoliosV01 at 392
check;

Error in ==> dynare at 132
evalin(‘base’,fname) ;

Error in ==> fnObjective at 16
dynare constant_portfoliosV01 noclearall msvc;

Hi Tarik,

Try to add a “clear functions” before every call to Dynare. It may solve the problem.

Another thing to try is to add a pause (with “pause 2”) before every run of Dynare.

Best,