Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: [Working with MLIB files] Issues with Stata Compiler and earlier Stata versions

From   George Vega Yon <>
Subject   st: [Working with MLIB files] Issues with Stata Compiler and earlier Stata versions
Date   Mon, 18 Mar 2013 17:42:43 -0300

Dear Stata Users,

I have the following problem: I'm writing a Stata module which uses
several MATA functions (routines) some of them generic, which is why
I've choose to distribuit it through .mlib files. The thing is that,
after building the .milb file using Stata 12.1 (where the module
works), trying it out in Stata 12.0 returns the following error:

. cnu_afili 65
(mt_cnu_2_1() in lcnu, compiled by Stata 12.1, is too new to be run by
this version of Stata and so was ignored)
                 <istmt>:  3499  mt_cnu_2_1() not found

At first I thought that "versioning" the functions would help, but
after adding "version 9.0" at the begining of all the mata functions,
Stata 12.0 keeps returning the same error. A example of a function is:

real colvector mt_mejoramiento_tabla(
	real colvector qx,        // Valor Qx (Mortalidad)
	real colvector aa,        // Valor AA (Factor de mejoramiento)
	real scalar agno_qx,      // Agno de la tabla
	real scalar agno_actual,  // Agno de calculo
	real scalar edad          // Edad del individuo
	version 9.0
	real scalar difagnos
	difagnos = agno_actual - agno_qx

	return(qx :* (1 :- aa):^(difagnos :+ (1::rows(qx)) :- edad :-1))


mata mlib create lcnu, replace
mata mlib add lcnu *()

Am I doing something wrong here? If everything is Ok, what suggestions
do you have? I'm hoping to share this through SSC


George Vega Yon
7 647 2552
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index