was trying to resolve the undefined symbol '_ftime" but the only way I found was to build a dll.
and copy the dll and importlib to the appropiate places.
Code: Select all
Structure mapm;M_APM_struct
*m_apm_data.c
m_apm_id.l
m_apm_refcount.l;int
m_apm_malloclength.l;int
m_apm_datalength.l;int
m_apm_exponent.l;int
m_apm_sign.l;int
EndStructure
ImportC "libmapm.lib"
*pMM_Zero As "__imp_MM_Zero"
*pMM_One As "__imp_MM_One"
*pMM_Two As "__imp_MM_Two"
*pMM_Three As "__imp_MM_Three"
*pMM_Four As "__imp_MM_Four"
*pMM_Five As "__imp_MM_Five"
*pMM_Ten As "__imp_MM_Ten"
*pMM_PI As "__imp_MM_PI"
*pMM_HALF_PI As "__imp_MM_HALF_PI"
*pMM_2_PI As "__imp_MM_2_PI"
*pMM_E As "__imp_MM_E"
*pMM_LOG_E_BASE_10 As "__imp_MM_LOG_E_BASE_10"
*pMM_LOG_10_BASE_E As "__imp_MM_LOG_10_BASE_E"
*pMM_LOG_2_BASE_E As "__imp_MM_LOG_2_BASE_E"
*pMM_LOG_3_BASE_E As "__imp_MM_LOG_3_BASE_E"
m_apm_init()
m_apm_free(*n.mapm)
m_apm_free_all_mem()
m_apm_trim_mem_usage()
m_apm_set_string(*n.mapm,sn.s)
m_apm_set_long(*mp.mapm, long.l)
m_apm_set_double(*mp.mapm, dbl.d)
m_apm_to_string(buffer.s, dplaces.l, *n.mapm)
m_apm_to_fixpt_string(buffer.s, dplaces.l, *n.mapm)
m_apm_to_fixpt_stringex(buffer.s, dplaces.l, *n.mapm, radix.c, separator_char.c, separator_count.l)
; example use
; m_apm_to_fixpt_stringex(s,20,*m,'.',',',5)
m_apm_to_fixpt_stringexp(dplaces.l, *n.mapm, radix.c, separator_char.c, separator_count.l)
; example use
; al.l=m_apm_to_fixpt_stringexp(100,*m,'.',',',5)
; s=PeekS(al)
m_apm_to_integer_string(buffer.s, *n.mapm)
m_apm_absolute_value(*r.mapm, *n.mapm)
m_apm_negate(*r.mapm, *n.mapm)
m_apm_copy(*r.mapm, *n.mapm)
m_apm_round(*r.mapm, decimal_places.l, *n.mapm)
m_apm_compare.l(*x.mapm, *y.mapm)
m_apm_sign.l(*x.mapm)
m_apm_exponent.l(*x.mapm)
m_apm_significant_digits.l(*x.mapm)
m_apm_is_integer.l(*x.mapm)
m_apm_is_even.l(*x.mapm)
m_apm_is_odd.l(*x.mapm)
m_apm_gcd(*result.mapm, *x.mapm, *y.mapm)
m_apm_lcm(*result.mapm, *x.mapm, *y.mapm)
m_apm_add(*result.mapm, *x.mapm, *y.mapm)
m_apm_subtract(*result.mapm, *x.mapm, *y.mapm)
m_apm_multiply(*result.mapm, *x.mapm, *y.mapm)
m_apm_divide(*result.mapm, dplaces.l, *x.mapm, *y.mapm)
m_apm_integer_divide(*result.mapm, *x.mapm, *y.mapm)
m_apm_integer_div_rem(*quot.mapm, *rem.mapm, *x.mapm, *y.mapm)
m_apm_reciprocal(*result.mapm, dplaces.l, *x.mapm)
m_apm_factorial(*result.mapm, *x.mapm)
m_apm_floor(*result.mapm, *x.mapm)
m_apm_ceil(*result.mapm, *x.mapm)
m_apm_get_random(*result.mapm)
m_apm_set_random_seed(s.s)
m_apm_sqrt(*result.mapm, dplaces.l, *x.mapm)
m_apm_cbrt(*result.mapm, dplaces.l, *x.mapm)
m_apm_log(*result.mapm, dplaces.l, *x.mapm)
m_apm_log10(*result.mapm, dplaces.l, *x.mapm)
m_apm_exp(*result.mapm, dplaces.l, *x.mapm)
m_apm_pow(*result.mapm, dplaces.l, *x.mapm, *y.mapm)
m_apm_integer_pow(*result.mapm, dplaces.l, *x.mapm, y.l)
m_apm_integer_pow_nr(*result.mapm, *x.mapm, y.l)
m_apm_sin_cos(*sin.mapm, *cos.mapm, dplaces.l, *x.mapm)
m_apm_sin(*result.mapm, dplaces.l, *x.mapm)
m_apm_cos(*result.mapm, dplaces.l, *x.mapm)
m_apm_tan(*result.mapm, dplaces.l, *x.mapm)
m_apm_arcsin(*result.mapm, dplaces.l, *x.mapm)
m_apm_arccos(*result.mapm, dplaces.l, *x.mapm)
m_apm_arctan(*result.mapm, dplaces.l, *x.mapm)
m_apm_arctan2(*result.mapm, dplaces.l, *x.mapm, *y.mapm)
m_apm_sinh(*result.mapm, dplaces.l, *x.mapm)
m_apm_cosh(*result.mapm, dplaces.l, *x.mapm)
m_apm_tanh(*result.mapm, dplaces.l, *x.mapm)
m_apm_arcsinh(*result.mapm, dplaces.l, *x.mapm)
m_apm_arccosh(*result.mapm, dplaces.l, *x.mapm)
m_apm_arctanh(*result.mapm, dplaces.l, *x.mapm)
EndImport
*MM_Zero = PeekL(*pMM_Zero)
*MM_One = PeekL(*pMM_One)
*MM_Two = PeekL(*pMM_Two)
*MM_Three = PeekL(*pMM_Three)
*MM_Four = PeekL(*pMM_Four)
*MM_Five = PeekL(*pMM_Five)
*MM_Ten = PeekL(*pMM_Ten)
*MM_PI = PeekL(*pMM_PI)
*MM_HALF_PI = PeekL(*pMM_HALF_PI)
*MM_2_PI = PeekL(*pMM_2_PI)
*MM_E = PeekL(*pMM_E)
*MM_LOG_E_BASE_10 = PeekL(*pMM_LOG_E_BASE_10)
*MM_LOG_10_BASE_E = PeekL(*pMM_LOG_10_BASE_E)
*MM_LOG_2_BASE_E = PeekL(*pMM_LOG_2_BASE_E)
*MM_LOG_3_BASE_E = PeekL(*pMM_LOG_3_BASE_E)
OpenConsole()
*n.mapm
*m.mapm
*k.mapm
*n=m_apm_init()
*m=m_apm_init()
*k=m_apm_init()
;<<<<<<<< this works OK >>>>>>>>>
s.s=Space(512)
m_apm_to_string(s, 100, PeekL(*pMM_PI))
PrintN(s)
;<<<<<<<< why does the following not work? >>>>>>>>>
s.s=Space(512)
m_apm_to_string(s, 100, *MM_PI)
PrintN(s)
Input()
m_apm_free(*k)
m_apm_free(*m)
m_apm_free(*n)
CloseConsole()