Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2000
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

mathlink

  • To: mathgroup at smc.vnet.net
  • Subject: [mg25229] mathlink
  • From: Richard S Hsu <rhsu at U.Arizona.EDU>
  • Date: Fri, 15 Sep 2000 02:22:00 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

I am learning MathLink. I copied the .tm and .c files from the Mathmatica
book(version 3).

file f.c :
------------------------------------------------------------
#include "mathlink.h"

int f(int x, int, y) {
    return x+y ;
}

int main(int argc, char *argv[]) {
    return MLMain(argc, argv);
}
--------------------------------------------------------------------

file f.tm :
--------------------------------------------------------------------
:Begin:
:Function:       f
:Pattern:        f[x_Integer, y_Integer]
:Arguments:      {x, y}
:ArgumentTypes:  {Integer, Integer}
:ReturnType:     Integer
:End:
---------------------------------------------------------------------

When I run  ' mcc f.em ', I got the error messages:

/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x57): undefined reference to `main'
/tmp/cca105961.o: In function `_tr0':
/tmp/cca105961.o(.text+0x5d): undefined reference to `f'

I use a Linux system.

Thank for help.



  • Prev by Date: How to display the desired numerical precision?
  • Next by Date: First derivative of interpolated spline
  • Previous by thread: Re: Re: mathlink
  • Next by thread: Re: Re: mathlink